Exemplo n.º 1
0
    def make_decoder(self):
        return nn.Sequential(

            nn.ReLU(),
            nn.Dropout2d(p=self.dropout),

            nn.Linear(self.latent_dim, 1500),
            nn.BatchNorm1d(1500),
            nn.ReLU(),
            nn.Linear(1500, 3136),
            nn.BatchNorm1d(3136),
            nn.ReLU(),
            nn.Dropout2d(p=self.dropout),
            Reshape(64, 7, 7),

            nn.MaxUnpool2d(kernel_size=2, stride=2),
            nn.ConvTranspose2d(64, 64, kernel_size=3, stride=1, padding=1),
            nn.BatchNorm2d(64),
            nn.ReLU(),

            nn.MaxUnpool2d(kernel_size=2, stride=2),
            nn.ConvTranspose2d(64, 32, kernel_size=3, stride=1, padding=1),
            nn.BatchNorm2d(32),
            nn.ReLU(),

            nn.ConvTranspose2d(32, 1, kernel_size=3, stride=1, padding=1)

        )
Exemplo n.º 2
0
 def make_decoder(self):
     return nn.Sequential(
         nn.Linear(self.latent_dim, 512), nn.ReLU(), Reshape(32, 4, 4),
         nn.MaxUnpool2d(kernel_size=2, stride=2),
         nn.ConvTranspose2d(32, 16, kernel_size=3, stride=1, padding=1),
         nn.BatchNorm2d(16), nn.ReLU(),
         nn.MaxUnpool2d(kernel_size=2, stride=2),
         nn.ConvTranspose2d(16, 8, kernel_size=3, stride=1, padding=1),
         nn.BatchNorm2d(8), nn.ReLU(),
         nn.MaxUnpool2d(kernel_size=2, stride=2),
         nn.ConvTranspose2d(8, 3, kernel_size=3, stride=1, padding=1))
Exemplo n.º 3
0
 def make_decoder(self):
     return nn.Sequential(
         nn.ReLU(), nn.Linear(self.latent_dim, 4096), nn.ReLU(),
         Reshape(256, 4, 4), nn.MaxUnpool2d(kernel_size=2, stride=2),
         nn.BatchNorm2d(256),
         nn.ConvTranspose2d(256, 128, kernel_size=3, stride=1, padding=1),
         nn.ReLU(), nn.MaxUnpool2d(kernel_size=2, stride=2),
         nn.BatchNorm2d(128),
         nn.ConvTranspose2d(128, 64, kernel_size=3, stride=1, padding=1),
         nn.ReLU(), nn.MaxUnpool2d(kernel_size=2, stride=2),
         nn.BatchNorm2d(64),
         nn.ConvTranspose2d(64, 3, kernel_size=3, stride=1, padding=1),
         nn.ReLU())
Exemplo n.º 4
0
 def make_decoder(self):
     return nn.Sequential(
         nn.ReLU(), nn.Linear(512, 4096), nn.BatchNorm1d(4096), nn.ReLU(),
         Reshape(64, 8, 8), nn.MaxUnpool2d(kernel_size=2, stride=2),
         nn.ConvTranspose2d(64, 64, kernel_size=3, stride=1, padding=1),
         nn.BatchNorm2d(64), nn.ReLU(),
         nn.ConvTranspose2d(64, 32, kernel_size=3, stride=1, padding=1),
         nn.BatchNorm2d(32), nn.ReLU(),
         nn.MaxUnpool2d(kernel_size=2, stride=2),
         nn.ConvTranspose2d(32, 32, kernel_size=3, stride=1, padding=1),
         nn.BatchNorm2d(32), nn.ReLU(),
         nn.ConvTranspose2d(32, 3, kernel_size=3, stride=1, padding=1),
         nn.BatchNorm2d(3))
Exemplo n.º 5
0
    def make_decoder(self):
        return nn.Sequential(

            nn.ReLU(),
            nn.Linear(160, 3200),
            nn.ReLU(),
            nn.Linear(3200, 5000),
            Reshape(50, 10, 10),
            nn.MaxUnpool2d(kernel_size=2, stride=2),

            nn.ConvTranspose2d(50, 50, kernel_size=5, stride=1, padding=0),
            nn.BatchNorm2d(50),
            nn.ReLU(),

            nn.ConvTranspose2d(50, 1, kernel_size=5, stride=1, padding=0)
        )
Exemplo n.º 6
0
    def make_decoder(self):
        return nn.Sequential(

            nn.ReLU(),
            nn.Dropout2d(p=self.dropout),

            nn.Linear(self.latent_dim, 3136),
            nn.ReLU(),
            nn.Dropout2d(p=self.dropout),
            nn.Linear(3136, 6272),
            nn.ReLU(),
            Reshape(32, 14, 14),

            nn.MaxUnpool2d(kernel_size=2, stride=2),
            nn.ConvTranspose2d(32, 1, kernel_size=3, stride=1, padding=1)

        )
Exemplo n.º 7
0
    def make_decoder(self):
        return nn.Sequential(

            nn.ReLU(),

            nn.Linear(self.latent_dim, 2450),
            nn.BatchNorm1d(2450),
            nn.ReLU(),
            nn.Dropout2d(p=self.dropout),
            Reshape(50, 7, 7),

            nn.MaxUnpool2d(kernel_size=2, stride=2),
            nn.ConvTranspose2d(50, 20, kernel_size=5, stride=1, padding=2),
            nn.BatchNorm2d(20),
            nn.ReLU(),

            nn.MaxUnpool2d(kernel_size=2, stride=2),
            nn.ConvTranspose2d(20, 1, kernel_size=5, stride=1, padding=2)

        )