資源簡介
基于Cifar數據集,控制對抗神經網絡(cgan)的實現,生成圖片
代碼片段和文件信息
import?pickle
import?numpy?as?np
import?argparse
import?torch
import?torch.nn?as?nn
import?torch.nn.functional?as?F
import?torch.optim?as?optim
from?torchvision?import?datasets?transforms
from?torch.autograd?import?Variable
import?matplotlib.pyplot?as?plt
import?torchvision
import?os
import?matplotlib.gridspec?as?gridspec
class?Generator(nn.Module):
????def?__init__(self):
????????super(Generator?self).__init__()
????????self.latent_vars?=?100
????????self.g_fc?=?nn.Linear(self.latent_vars?512)
????????self.dconv1?=?nn.ConvTranspose2d(512?256?kernel_size=3?stride=2)
????????self.dconv2?=?nn.ConvTranspose2d(256?128?kernel_size=3?stride=2)
????????self.dconv3?=?nn.ConvTranspose2d(128?64?kernel_size=3?stride=2)
????????self.dconv4?=?nn.ConvTranspose2d(64?3?kernel_size=3?st
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2017-04-27?18:54??cgan-master\
?????文件??????????22??2017-04-27?18:54??cgan-master\.gitignore
?????文件???????????6??2017-04-27?18:54??cgan-master\README.md
?????文件????????4698??2017-04-27?18:54??cgan-master\cgan_cifar.py
?????文件????????4895??2017-04-27?18:54??cgan-master\cgan_cifar10.py
?????文件????????3733??2017-04-27?18:54??cgan-master\cgan_mnist.py
?????文件????????3674??2017-04-27?18:54??cgan-master\wgan.py
?????文件????????7906??2017-04-27?18:54??cgan-master\wgan_cifar.py
- 上一篇:分支限界解決tsp問題
- 下一篇:《軟件測試與文檔編制》期末考試試卷
評論
共有 條評論