This is a Python implementation of Y. Weiss's Spectral Hashing.
-
The eigen vectors solved by Python and MATLAB may have different sign, thus the binary code generated by Python and MATLAB might be different. However, the result of
hammingDist(B, B)
withB
from either Python or MABLAB will get the same results. -
By manually adjust the sign of the eigen vectors in Python (
trainSH
), you can get the same binary code from Python as from MABLAB.