Created
May 9, 2020 10:40
-
-
Save AshNguyen/2e4f43bad14bc3a749e1f06861143c0a to your computer and use it in GitHub Desktop.
Revisions
-
AshNguyen created this gist
May 9, 2020 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,21 @@ class AE(nn.Module): def __init__(self, n_latent): super(AE, self).__init__() self.encoder = nn.Sequential( nn.Linear(28 * 28, 128), nn.ReLU(True), nn.Linear(128, 64), nn.ReLU(True), nn.Linear(64, n_latent)) self.decoder = nn.Sequential( nn.Linear(n_latent, 64), nn.ReLU(True), nn.Linear(64, 128), nn.ReLU(True), nn.Linear(128, 28 * 28), nn.Sigmoid()) def forward(self, x): x = self.encoder(x) x = self.decoder(x) return x