Here is my code for the Discriminator ``` import torch import torch.nn as nn # start with CNN block class CNNBlock(nn.Module): # for convolutional layer def __init__(self, in_channels, out_channels, stride=2): super().__init__() # create a block self.conv = nn.Sequential( nn.Conv2d(in_channels, out_channels,kernel_size=4 , stride=stride, bias=False, padding_mode="reflect"), nn.InstanceNorm2d(out_channels, affine=True), nn.LeakyReLU(0.2), ) # forward propogation def forward(self, x): conv_result = self.conv(x) return conv_result class Discriminator(nn.Module): def __init__(self, in_channels=3, # in channels 3 as default because normally have rgb features=[64, 128, 256, 512], # used in paper: take in channels, send to 64, then 64 to 128, then to 256, and lastly 512 ): # using this cnn block 4 times # send in 256 input, after conv layers get 30 x 30 output super().__init__() self.initial = nn.Sequential( nn.Conv2d( in_channels * 2, features[0], kernel_size=4, stride=2, padding=1, padding_mode="reflect" ), nn.LeakyReLU(0.2) ) layers = [] in_channels = features[0] counter =0 for feature in features[1:]: counter = counter+1 layers.append( CNNBlock(in_channels, feature, stride=1 if feature == features[-1] else 2) ) in_channels = feature # need to output a single value between 0 and 1 # need another conv layer layers.append( nn.Conv2d( in_channels, 1, kernel_size=4, stride=1, padding=1, padding_mode="reflect" ) ) self.model = nn.Sequential(*layers) def forward(self, x, y): x = torch.cat([x, y], dim=1) # concatentate x and y along the first dimension x = self.initial(x) # send it through the initial thing model_x_result = self.model(x) return model_x_result ```