fixing format detm
@@ -8,7 +8,7 @@ from torch import nn
class DETM(nn.Module):
- def __init__(self, num_topics, num_times, vocab_size, t_hidden_size, eta_hidden_size,
+ def __init__(self, num_topics, num_times, vocab_size, t_hidden_size, eta_hidden_size, eta_dropout,
rho_size, emb_size, enc_drop, eta_nlayers, delta, train_embeddings,
theta_act, embeddings):
super(DETM, self).__init__()
@@ -26,7 +26,7 @@ class DETM(nn.Module):
self.eta_nlayers = eta_nlayers
self.t_drop = nn.Dropout(enc_drop)
self.delta = delta
- self.train_embeddings = rain_embeddings
+ self.train_embeddings = train_embeddings
self.theta_act = self.get_activation(theta_act)
@@ -167,7 +167,7 @@ class DETM(nn.Module):
logsigma_theta = self.logsigma_q_theta(q_theta)
z = self.reparameterize(mu_theta, logsigma_theta)
theta = F.softmax(z, dim=-1)
- kl_theta = self.get_kl(mu_theta, logsigma_theta, eta_td, torch.zeros(self.num_topics).to(device))
+ kl_theta = self.get_kl(mu_theta, logsigma_theta, eta_td, torch.zeros(self.num_topics).to(self.device))
return theta, kl_theta
def get_beta(self, alpha):
