Last active
May 17, 2020 06:12
-
-
Save gchhablani/4ee6e5f0b6805a5ac9c82445ad525e7b to your computer and use it in GitHub Desktop.
Autoencoder in PyTorch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class AE(nn.Module): | |
def __init__(self): | |
super(AE,self).__init__() | |
self.encoder = nn.Sequential(nn.Linear(784,50),nn.ReLU(),nn.Linear(50,50),nn.ReLU()) | |
self.decoder = nn.Sequential(nn.Linear(14,50),nn.ReLU(),nn.Linear(50,50),nn.ReLU(),nn.Linear(50,784),nn.ReLU()) | |
def forward(self,inp): | |
return self.decoder(self.encoder(inp)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment