removed the boolean topic_doc_matrix and topic_word_matrix from avitm
@@ -23,7 +23,7 @@ class AVITM_model(object):
hidden_sizes=(100, 100), activation='softplus', dropout=0.2,
learn_priors=True, batch_size=64, lr=2e-3, momentum=0.99,
solver='adam', num_epochs=100, reduce_on_plateau=False,
- topic_prior_mean=0.0, topic_prior_variance=None, topic_word_matrix=True, topic_document_matrix=True):
+ topic_prior_mean=0.0, topic_prior_variance=None):
"""
Initialize AVITM model.
@@ -87,8 +87,6 @@ class AVITM_model(object):
self.reduce_on_plateau = reduce_on_plateau
self.topic_prior_mean = topic_prior_mean
self.topic_prior_variance = topic_prior_variance
- self.bool_t_w = topic_word_matrix
- self.bool_t_d = topic_document_matrix
# init inference avitm network
self.model = DecoderNetwork(
input_size, num_topics, model_type, hidden_sizes, activation,
@@ -316,7 +314,6 @@ class AVITM_model(object):
topic_document_mat.append(topic_document)
results = self.get_info()
- if self.bool_t_d:
results['test-topic-document-matrix2'] = np.vstack(
np.asarray([i.cpu().detach().numpy() for i in topic_document_mat])).T
results['test-topic-document-matrix'] = np.asarray(self.get_thetas(dataset)).T
@@ -360,11 +357,9 @@ class AVITM_model(object):
topic_document_dist = self.get_topic_document_mat()
info['topics'] = topic_word
- if self.bool_t_d:
info['topic-document-matrix2'] = topic_document_dist.T
info['topic-document-matrix'] = np.asarray(self.get_thetas(self.train_data)).T
- if self.bool_t_w:
info['topic-word-matrix'] = topic_word_dist
return info
