-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Word2Vec/Doc2Vec offer model-minimization method #446
Comments
add finished_training method
Since I initially wrote this, I've seen cases where the non-unit-normalized So utility functions for this model-slimming need to be very carefully named and documented to set expectations properly - and perhaps factored to separate operations, rather than one big |
* issue #446 add finished_training method * private _minimize_model, tests We can't just call «the super method in word2vec explicitly» without adding the flag to save syn0_lockf, which as is necessary to save in d2v. * fix_print * flag finished_training fix * fix_bug with docvecs, controllability * rename flag, flag move, init_sims * renaming the RuntimeError message * fix, add more tests * fix, i == j * fix * tests_fix * delete useless code * numpy fix * hs,neg in tests; assert parameters existance * changelog update * rename replace, description fix
Fixed in #987 |
If you're sure you're done training a model, a bunch of its memory-consumptive parts can be discarded:
There should be a documented method (such as
finished_training
) to discard these, and testing to ensure there are no lingering unintended dependencies on those sticking around.Semantics: As a tradeoff,
finished_training
discards as many model attributes as possible, while still being able to answerinfer_vector
and__getitem__
queries on the resulting trimmed model. No more continued training on that word2vec/doc2vec model is possible, and any attempt to do so results in a clear, understandable exception.(Note though that a Doc2Vec model used for future
infer_vector()
ops needs to keep the syn0 & syn1* values.)The text was updated successfully, but these errors were encountered: