nateraw / Lda2vec-Tensorflow

Tensorflow 1.5 implementation of Chris Moody's Lda2vec, adapted from @meereeum
MIT License
107 stars 40 forks source link

Restore not working properly after updates #37

Closed nateraw closed 5 years ago

nateraw commented 5 years ago

When we simplified the model, we deleted some of the variables in handles within the model to make the code less confusing. However, after reviewing, we can see that the word embedding variables and the doc mixture variables are not saved + reloaded properly.

The main reason for this is because they are stored within the w_embed and doc_mixture class instances, which are not savable in the config file. So, we need to extract these variables and add them to the config manually to allow for restore to work properly.

nateraw commented 5 years ago

Fixed. If you want to restore a model, pass restore=True upon initialization of the model and pass the name of the log directory where your model is saved to logdir too.

ex.

m = model(num_docs, vocab_size, num_topics,
          ...
          restore=True,
          logdir="logdir_190313_1905")