Created
December 17, 2021 14:57
-
-
Save vinimonteiro/10868b3cd158755d0998dcae92dffba0 to your computer and use it in GitHub Desktop.
nn_pytorch_neuralnet
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class NeuralNetwork(nn.Module): | |
def __init__(self): | |
super().__init__() | |
self.fc1 = nn.Linear(784, 86) | |
self.fc2 = nn.Linear(86, 86) | |
self.fc3 = nn.Linear(86, 86) | |
self.fc4 = nn.Linear(86, 10) | |
def forward(self, x): | |
x = F.relu(self.fc1(x)) | |
x = F.relu(self.fc2(x)) | |
x = F.relu(self.fc3(x)) | |
x = self.fc4(x) | |
return F.log_softmax(x, dim=1) | |
model = NeuralNetwork() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment