Public Member Functions | |
Taccu | compute (const int *perm) const |
Taccu | compute_update (const int *perm, int iw, int jw) const |
Taccu | update_i (const int *perm, int iw, int jw, int ip0, int ip, const Ttab *n_gt_i) const |
Taccu | update_i_plane (const int *perm, int iw, int jw, int ip0, int ip, const Ttab *n_gt_i) const |
Taccu | update_k (const int *perm, int iw, int jw, int ip0, int ip, int jp0, int jp, int k, const Ttab *n_gt_ij) const |
used for the 8 cells were the 3 indices are swapped | |
Taccu | update_j_line (const int *perm, int iw, int jw, int ip0, int ip, int jp0, int jp, const Ttab *n_gt_ij) const |
compute update on a line of k's, where i and j are swapped | |
Taccu | update_i_cross (const int *perm, int iw, int jw, int ip0, int ip, const Ttab *n_gt_i) const |
considers the 2 pairs of crossing lines j=iw or jw and k = iw or kw | |
double | compute_cost (const int *perm) const override |
double | cost_update (const int *perm, int iw, int jw) const override |
Public Attributes | |
int | nc |
std::vector< Ttab > | n_gt |
![]() | |
int | n |
Maintains a 3D table of elementary costs. Accumulates elements based on Hamming distance comparisons
Definition at line 443 of file PolysemousTraining.cpp.
|
inline |
the cost is a triple loop on the nc * nc * nc matrix of entries.
Definition at line 455 of file PolysemousTraining.cpp.
|
inlineoverridevirtual |
PermutationObjective implementeation (just negates the scores for minimization)
Implements faiss::PermutationObjective.
Definition at line 631 of file PolysemousTraining.cpp.
|
inline |
cost update if entries iw and jw of the permutation would be swapped.
The computation is optimized by avoiding elements in the nc*nc*nc cube that are known not to change. For nc=256, this reduces the nb of cells to visit to about 6/256 th of the cells. Practical speedup is about 8x, and the code is quite complex :-/
Definition at line 486 of file PolysemousTraining.cpp.