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_sample = 1 # adjustable parameter, though 1 works best in practice
self.n_batch = n_batch
self.n_lat = 200
self.n_dim = n_dim
self.n_chan = n_chan
self.n_batch = n_batch
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_px_mu, l_px_logsigma, l_pa_mu, l_pa_logsigma, \
l_qz_mu, l_qz_logsigma, l_qa_mu, l_qa_logsigma, \
l_qa, l_qz = self.network
sample = lasagne.layers.get_output(l_px_mu, {l_qz : Z}, deterministic=True)
self.sample = theano.function([Z], sample, on_unused_input='warn')
评论列表
文章目录