Example #1
0
                               unit='linear',
                               init_W=init_W,
                               init_b=init_b)

prior_sig = FullyConnectedLayer(name='prior_sig',
                                parent=['prior_4'],
                                parent_dim=[p_z_dim],
                                nout=latent_size,
                                unit='softplus',
                                cons=1e-4,
                                init_W=init_W,
                                init_b=init_b_sig)

kl = PriorLayer(name='kl',
                parent=['phi_mu', 'phi_sig', 'prior_mu', 'prior_sig'],
                parent_dim=[latent_size, latent_size, latent_size, latent_size],
                use_sample=0,
                nout=latent_size)

theta_1 = FullyConnectedLayer(name='theta_1',
                              parent=['z_4', 's_tm1'],
                              parent_dim=[z2s_dim, main_lstm_dim],
                              nout=p_x_dim,
                              unit='relu',
                              init_W=init_W,
                              init_b=init_b)

theta_2 = FullyConnectedLayer(name='theta_2',
                              parent=['theta_1'],
                              parent_dim=[p_x_dim],
                              nout=p_x_dim,
Example #2
0
                               unit='linear',
                               init_W=init_W,
                               init_b=init_b)

prior_sig = FullyConnectedLayer(name='prior_sig',
                                parent=['prior_4'],
                                parent_dim=[p_z_dim],
                                nout=latent_size,
                                unit='softplus',
                                cons=1e-4,
                                init_W=init_W,
                                init_b=init_b_sig)

kl = PriorLayer(name='kl',
                parent=['phi_mu', 'phi_sig', 'prior_mu', 'prior_sig'],
                parent_dim=[latent_size, latent_size, latent_size, latent_size],
                use_sample=0,
                nout=latent_size)

theta_1 = FullyConnectedLayer(name='theta_1',
                              parent=['z_4', 's_tm1'],
                              parent_dim=[z2s_dim, main_lstm_dim],
                              nout=p_x_dim,
                              unit='relu',
                              init_W=init_W,
                              init_b=init_b)

theta_2 = FullyConnectedLayer(name='theta_2',
                              parent=['theta_1'],
                              parent_dim=[p_x_dim],
                              nout=p_x_dim,
Example #3
0
                             nout=latent_dim,
                             unit='linear',
                             init_W=init_W,
                             init_b=init_b)

phi_sig = FullyConnectedLayer(name='phi_sig',
                              parent=['enc'],
                              parent_dim=[256],
                              nout=latent_dim,
                              unit='softplus',
                              init_W=init_W,
                              init_b=init_b_sig)

prior = PriorLayer(name='prior',
                   parent=['phi_mu', 'phi_sig'],
                   parent_dim=[latent_dim, latent_dim],
                   use_sample=1,
                   nout=latent_dim)

kl = PriorLayer(name='kl',
                parent=['phi_mu', 'phi_sig'],
                parent_dim=[latent_dim, latent_dim],
                use_sample=0,
                nout=latent_dim)

dec = LSTM(name='dec',
           parent=['prior'],
           parent_dim=[latent_dim],
           batch_size=batch_size,
           nout=256,
           unit='tanh',