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')
评论列表
文章目录