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

Method __init__

GANCode/gModel.py:13–22  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

11
12class Generator(torch.nn.Module):
13 def __init__(self):
14 super(Generator, self).__init__()
15 self.fc = torch.nn.Sequential(
16 torch.nn.Linear(in_features=100,out_features=256),
17 torch.nn.ReLU(),
18 torch.nn.Linear(in_features=256,out_features=512),
19 torch.nn.ReLU(),
20 torch.nn.Linear(in_features=512,out_features=784),
21 torch.nn.Tanh()#对于生成器使用tanh激活函数更好
22 )
23 def forward(self,input):
24 x = self.fc(input)
25 img = x.view(-1,28,28)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected