| 10 | |
| 11 | class Generator(torch.nn.Module): |
| 12 | def __init__(self,in_features = 100,W = 28,H = 28): |
| 13 | super(Generator, self).__init__() |
| 14 | self.fc_layer_1 = torch.nn.Sequential( |
| 15 | torch.nn.Linear(in_features = in_features,out_features=256), |
| 16 | torch.nn.BatchNorm1d(num_features=256), |
| 17 | torch.nn.ReLU() |
| 18 | ) |
| 19 | self.fc_layer_2 = torch.nn.Sequential( |
| 20 | torch.nn.Linear(in_features=10,out_features=256), |
| 21 | torch.nn.BatchNorm1d(num_features=256), |
| 22 | torch.nn.ReLU() |
| 23 | ) |
| 24 | self.fc_layer_3 = torch.nn.Sequential( |
| 25 | torch.nn.Linear(in_features=512,out_features=512), |
| 26 | torch.nn.BatchNorm1d(num_features=512), |
| 27 | torch.nn.ReLU() |
| 28 | ) |
| 29 | self.fc_layer_4 = torch.nn.Sequential( |
| 30 | torch.nn.Linear(in_features=512,out_features=1024), |
| 31 | torch.nn.BatchNorm1d(num_features=1024), |
| 32 | torch.nn.ReLU() |
| 33 | ) |
| 34 | self.fc_layer_final = torch.nn.Linear(in_features=1024,out_features=H * W) |
| 35 | |
| 36 | def forward(self,input,label): |
| 37 | x = self.fc_layer_1(input) |