def decode(self,z):
# pdb.set_trace()
a = self.a_enc
# If this function is coming from the sampling call, the batch size of z and a won't match. Manually handle that here.
if (a.shape[0]!=z.shape[0]):
a.volatile = 'ON'
batch_size = z.shape[0]
a.data = a.data[0:batch_size,:]
net_input = F.concat((z,a), axis=1)
h = F.crelu(self.plinx0(net_input))
for i in range(self.num_layers-1):
layer_name = 'plinx' + str(i+1)
h = F.crelu(self[layer_name](h))
self.pmu = self.plinx_mu(h)
self.pln_var = self.plinx_ln_var(h)
return self.pmu, self.pln_var
评论列表
文章目录