Skip to content

Instantly share code, notes, and snippets.

@Noob-can-Compile
Created December 1, 2019 11:48
Show Gist options
  • Save Noob-can-Compile/a736a6a3d863d104ee7953d916a43b4b to your computer and use it in GitHub Desktop.
Save Noob-can-Compile/a736a6a3d863d104ee7953d916a43b4b to your computer and use it in GitHub Desktop.
def forward(self, x):
## TODO: Define the feedforward behavior of this model
## x is the input image and, as an example, here you may choose to include a pool/conv step:
## x = self.pool(F.relu(self.conv1(x)))
x = self.pool1(F.relu(self.conv1(x)))
x = self.drop1(x)
x = self.pool2(F.relu(self.conv2(x)))
x = self.drop2(x)
x = self.pool3(F.relu(self.conv3(x)))
x = self.drop3(x)
x = self.pool4(F.relu(self.conv4(x)))
x = self.drop4(x)
x = self.pool5(F.relu(self.conv5(x)))
x = self.drop5(x)
x = x.view(x.size(0), -1)
x = F.relu(self.fc1(x))
x = self.drop6(x)
x = self.fc2(x)
# a modified x, having gone through all the layers of your model, should be returned
return x
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment