(self, fn)
| 116 | print("svd cost:", cost) |
| 117 | |
| 118 | def save(self, fn): |
| 119 | # function word_analogies expects a (V,D) matrx and a (D,V) matrix |
| 120 | arrays = [self.W, self.U.T] |
| 121 | np.savez(fn, *arrays) |
| 122 | |
| 123 | |
| 124 | def main(we_file, w2i_file, use_brown=True, n_files=100): |