Benjamin Wilson
Benjamin Wilson
We use NNLS for this. We add the constraint that the entries sum to 1 by adding a column of 1s to the word vector matrix and augmenting the zero...
**The vector of `` does not change from init** words are delimited by space, tab and linefeeds (\n). while spaces and tabs are treated as delimiters and otherwise ignored, linefeeds...
**Excluding ``** ``` from scipy.optimize import nnls A = np.array(vectors.iloc[1:]).transpose() b = np.zeros((A.shape[0],)) Aaug = np.concatenate((A, np.ones((1, A.shape[1])))) baug = np.concatenate((b, np.ones((1,)))) p = nnls(Aaug, baug) print 'sum %f' %...
In the case of negative sampling, it might be sensible to expect that the noise distribution used for sampling corresponds to the vector 0. But the meaningless vector is also...