vae.py 文件源码

python
阅读 36 收藏 0 点赞 0 评论 0

项目:deep-learning-models 作者: kuleshov 项目源码 文件源码
def __init__(self, n_dim, n_out, n_chan=1, n_batch=128, n_superbatch=12800, model='bernoulli',
                opt_alg='adam', opt_params={'lr' : 1e-3, 'b1': 0.9, 'b2': 0.99}):
    # save model that wil be created
    self.model = model
    self.n_batch = n_batch
    self.n_lat = 100
    self.n_dim = n_dim
    self.n_chan = n_chan

    # invoke parent constructor
    Model.__init__(self, n_dim, n_chan, n_out, n_superbatch, opt_alg, opt_params)

    # sample generation
    Z = T.matrix(dtype=theano.config.floatX) # noise matrix
    _, _, _, _, l_sample, l_p_z = self.network
    sample = lasagne.layers.get_output(l_sample,  {l_p_z : Z}, deterministic=True)
    self.sample = theano.function([Z], sample, on_unused_input='warn')
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号