Skip to content

Instantly share code, notes, and snippets.

@albertlai431
Created December 4, 2018 00:30
Show Gist options
  • Save albertlai431/56c378070b8d3a85afeb5c2dccb3cebf to your computer and use it in GitHub Desktop.
Save albertlai431/56c378070b8d3a85afeb5c2dccb3cebf to your computer and use it in GitHub Desktop.
Forward Propagation
def forward(self, x):
#Convolution 1
out = self.cnn1(x)
out = self.relu1(out)
#Max pool 1
out = self.maxpool1(out)
#Convolution 2
out = self.cnn2(out)
out = self.relu2(out)
#Max pool 2
out = self.maxpool2(out)
#Resize
out = out.view(out.size(0), -1)
#Dropout
out = self.dropout(out)
#Fully connected 1
out = self.fc1(out)
return out
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment