Skip to content

Commit

Permalink
Fixed Input-Target Dimention Mismatch
Browse files Browse the repository at this point in the history
  • Loading branch information
iSiddharth20 committed Dec 24, 2023
1 parent af153e8 commit 747e92c
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions Code/autoencoder_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ def __init__(self):
Encoder takes 1-Chanel Grayscale image (1 channel) as input and outputs High-Dimentional-Representation
'''
self.encoder = nn.Sequential(
nn.Conv2d(1, 64, kernel_size=3, stride=2, padding=1),
nn.Conv2d(1, 64, kernel_size=3, stride=1, padding=1),
nn.ReLU(),
nn.Conv2d(64, 128, kernel_size=3, stride=2, padding=1),
nn.Conv2d(64, 128, kernel_size=3, stride=1, padding=1),
nn.ReLU(),
nn.Conv2d(128, 256, kernel_size=3, stride=2, padding=1),
nn.Conv2d(128, 256, kernel_size=3, stride=1, padding=1),
nn.ReLU(),
nn.Conv2d(256, 512, kernel_size=3, stride=2, padding=1),
nn.Conv2d(256, 512, kernel_size=3, stride=1, padding=1),
nn.ReLU()
)

Expand All @@ -34,13 +34,13 @@ def __init__(self):
Decoder takes High-Dimentional-Representation as input and outputs 3-Chanel RGB image
'''
self.decoder = nn.Sequential(
nn.ConvTranspose2d(512, 256, kernel_size=3, stride=2, padding=1, output_padding=1),
nn.ConvTranspose2d(512, 256, kernel_size=3, stride=1, padding=1, output_padding=0),
nn.ReLU(),
nn.ConvTranspose2d(256, 128, kernel_size=3, stride=2, padding=1, output_padding=1),
nn.ConvTranspose2d(256, 128, kernel_size=3, stride=1, padding=1, output_padding=0),
nn.ReLU(),
nn.ConvTranspose2d(128, 64, kernel_size=3, stride=2, padding=1, output_padding=1),
nn.ConvTranspose2d(128, 64, kernel_size=3, stride=1, padding=1, output_padding=0),
nn.ReLU(),
nn.ConvTranspose2d(64, 3, kernel_size=3, stride=2, padding=1, output_padding=1),
nn.ConvTranspose2d(64, 3, kernel_size=3, stride=1, padding=1, output_padding=0),
nn.Sigmoid()
)

Expand Down

0 comments on commit 747e92c

Please sign in to comment.