Skip to content

Instantly share code, notes, and snippets.

@MLWhiz
Created September 7, 2020 14:47
Show Gist options
  • Save MLWhiz/1973979d4a95d649c46aaa8d998905d5 to your computer and use it in GitHub Desktop.
Save MLWhiz/1973979d4a95d649c46aaa8d998905d5 to your computer and use it in GitHub Desktop.
class myCrazyNeuralNet(nn.Module):
def __init__(self):
super().__init__()
# Define all Layers Here
self.lin1 = nn.Linear(784, 30)
self.lin2 = nn.Linear(30, 784)
self.lin3 = nn.Linear(30, 10)
def forward(self, x):
# Connect the layer Outputs here to define the forward pass
x_lin1 = self.lin1(x)
x_lin2 = x + self.lin2(x_lin1)
x_lin2 = self.lin1(x_lin2)
x = self.lin3(x_lin2)
return x
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment