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

Class Encoder

Adversarial_AutoEncoder/net/Encoder.py:11–26  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9from torchinfo import summary
10
11class Encoder(torch.nn.Module):
12 def __init__(self,in_features = 784,out_features = 128):
13 super(Encoder, self).__init__()
14 self.encoder = torch.nn.Sequential(
15 torch.nn.Linear(in_features=in_features, out_features=512),
16 torch.nn.ReLU(),
17
18 torch.nn.Linear(in_features=512, out_features=256),
19 torch.nn.ReLU(),
20
21 torch.nn.Linear(in_features=256, out_features=out_features),
22 )
23 def forward(self,x):
24 x = x.view(-1,784)
25 out = self.encoder(x)
26 return out
27
28if __name__ == '__main__':
29 model = Encoder(in_features=784,out_features=128)

Callers 2

train.pyFile · 0.90
Encoder.pyFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected