Created
June 19, 2019 18:45
-
-
Save darkmatter18/704afa08c3f25fb038ca835cd577eb9d to your computer and use it in GitHub Desktop.
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
#Import Torch.nn | |
from torch import nn | |
#Declaring Class | |
class Network(nn.Module): | |
def __init__(): | |
super(type(self), self).init() | |
self.hidden = nn.Linear(784, 256) | |
self.output = nn.Linear(256, 10) | |
self.sigmoid = nn.Sigmoid() | |
self.softmax = nn.Softmax(dim=1) | |
def forward(self, x): | |
x = self.hidden(x) | |
x = self.sigmoid(x) | |
x = self.output(x) | |
x = self.softmax(x) | |
return x | |
# Initialing the object | |
model = Network() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment