DETM ==== .. py:module:: topmost.models.dynamic.DETM Module Contents --------------- .. autoapisummary:: topmost.models.dynamic.DETM.DETM .. py:class:: DETM(vocab_size, num_times, train_size, train_time_wordfreq, num_topics=50, train_WE=True, pretrained_WE=None, en_units=800, eta_hidden_size=200, rho_size=300, enc_drop=0.0, eta_nlayers=3, eta_dropout=0.0, delta=0.005, theta_act='relu', device='cpu') Bases: :py:obj:`torch.nn.Module` The Dynamic Embedded Topic Model. 2019 Adji B. Dieng, Francisco J. R. Ruiz, David M. Blei .. py:attribute:: num_topics :value: 50 .. py:attribute:: num_times .. py:attribute:: vocab_size .. py:attribute:: eta_hidden_size :value: 200 .. py:attribute:: rho_size :value: 300 .. py:attribute:: enc_drop :value: 0.0 .. py:attribute:: eta_nlayers :value: 3 .. py:attribute:: t_drop .. py:attribute:: eta_dropout :value: 0.0 .. py:attribute:: delta :value: 0.005 .. py:attribute:: train_WE :value: True .. py:attribute:: train_size .. py:attribute:: rnn_inp .. py:attribute:: device :value: 'cpu' .. py:attribute:: theta_act :value: 'relu' .. py:attribute:: mu_q_alpha .. py:attribute:: logsigma_q_alpha .. py:attribute:: q_theta .. py:attribute:: mu_q_theta .. py:attribute:: logsigma_q_theta .. py:attribute:: q_eta_map .. py:attribute:: q_eta .. py:attribute:: mu_q_eta .. py:attribute:: logsigma_q_eta .. py:attribute:: decoder_bn .. py:method:: get_activation(act) .. py:method:: reparameterize(mu, logvar) Returns a sample from a Gaussian distribution via reparameterization. .. py:method:: get_kl(q_mu, q_logsigma, p_mu=None, p_logsigma=None) Returns KL( N(q_mu, q_logsigma) || N(p_mu, p_logsigma) ). .. py:method:: get_alpha() .. py:method:: get_eta(rnn_inp) .. py:method:: get_theta(bows, times, eta=None) Returns the topic proportions. .. py:property:: word_embeddings .. py:property:: topic_embeddings .. py:method:: get_beta(alpha=None) Returns the topic matrix eta of shape T x K x V .. py:method:: get_NLL(theta, beta, bows) .. py:method:: forward(bows, times) .. py:method:: init_hidden() Initializes the first hidden state of the RNN used as inference network for \eta.