MCPcopy Create free account
hub / github.com/KeepTryingTo/Pytorch-GAN / samples

Function samples

VAE_AutoEncoder/utils.py:91–99  ·  view source on GitHub ↗

:param args: 编码器产生的均值和噪声 :return:

(args)

Source from the content-addressed store, hash-verified

89 plt.savefig(os.path.join(config.SAVE_IMAGES,str(epoch)+"_"+str(step)+'.png'))
90
91def samples(args):
92 """
93 :param args: 编码器产生的均值和噪声
94 :return:
95 """
96 z_mean,z_log_var = args
97 eps = torch.nn.init.normal_(z_log_var,mean=0.,std=1.0)
98 z = z_mean + torch.exp(z_log_var / 2) * eps
99 return z
100
101def loss_fn(inputs,outputs,loss_fn,z_mean,z_log_var,num_features = 784):
102 reconstruction_loss = loss_fn(outputs,inputs)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected