hello, i tried to zeroing one row and column in last layer of encoder after training and show the result without train. can you help me??
#Define the Convolutional Autoencoder
class ConvAutoencoder(nn.Module):
def __init__(self):
super(ConvAutoencoder, self).__init__()
#Encoder
self.conv1 = nn.Conv2d(3, 16, 3, stride=2, padding=1)
self.conv2 = nn.Conv2d(16, 8, 3, stride=2, padding=1)
self.conv3 = nn.Conv2d(8,8,3)
#Decoder
self.conv4 = nn.ConvTranspose2d(8, 8, 3)
self.conv5 = nn.ConvTranspose2d(8, 16, 3, stride=2, padding=1, output_padding=1)
self.conv6 = nn.ConvTranspose2d(16, 3, 3, stride=2, padding=1, output_padding=1)
def forward(self, x):
x = F.relu(self.conv1(x))
x = F.relu(self.conv2(x))
x = F.relu(self.conv3(x))
x = F.relu(self.conv4(x))
x = F.relu(self.conv5(x))
x = F.relu(self.conv6(x))
# x=torch.sigmoid(x)
return x
#Instantiate the model
model = ConvAutoencoder()
print(model)