Hyperparameters ETM fixed
-#/usr/bin/python
+
from __future__ import print_function
import argparse
@@ -191,16 +191,16 @@ class ETM_Wrapper(Abstract_Model):
def set_default_hyperparameters(self, hyperparameters):
- self.hyperparameters['num_topics'] = hyperparameters.get('num_topics', 10)
- self.hyperparameters['epochs'] = hyperparameters.get('epochs', 20)
- self.hyperparameters['t_hidden_size'] = hyperparameters.get('t_hidden_size', 800)
- self.hyperparameters['rho_size'] = hyperparameters.get('rho_size', 300)
- self.hyperparameters['emb_size'] = hyperparameters.get('emb_size', 300)
- self.hyperparameters['theta_act'] = hyperparameters.get('theta_act', 'relu')
- self.hyperparameters['enc_drop'] = hyperparameters.get('enc_drop', 0.0)
- self.hyperparameters['lr'] = hyperparameters.get('lr', 0.005)
- self.hyperparameters['optimizer'] = hyperparameters.get('optimizer', 'adam')
- self.hyperparameters['batch_size'] = hyperparameters.get('batch_size', 128)
+ self.hyperparameters['num_topics'] = hyperparameters.get('num_topics', self.hyperparameters.get('num_topics', 10))
+ self.hyperparameters['epochs'] = hyperparameters.get('epochs', self.hyperparameters.get('epochs', 20))
+ self.hyperparameters['t_hidden_size'] = hyperparameters.get('t_hidden_size', self.hyperparameters.get('t_hidden_size',800))
+ self.hyperparameters['rho_size'] = hyperparameters.get('rho_size',self.hyperparameters.get('rho_size', 300))
+ self.hyperparameters['emb_size'] = hyperparameters.get('emb_size', self.hyperparameters.get('emb_size', 300))
+ self.hyperparameters['theta_act'] = hyperparameters.get('theta_act', self.hyperparameters.get('theta_act','relu'))
+ self.hyperparameters['enc_drop'] = hyperparameters.get('enc_drop',self.hyperparameters.get('enc_drop',0.0))
+ self.hyperparameters['lr'] = hyperparameters.get('lr', self.hyperparameters.get('lr',0.005))
+ self.hyperparameters['optimizer'] = hyperparameters.get('optimizer', self.hyperparameters.get('optimizer', 'adam')
+ self.hyperparameters['batch_size'] = hyperparameters.get('batch_size', self.hyperparameters.get('batch_size',128))
def partitioning(self, use_partitions=False):
if use_partitions:
