Skip to content

Instantly share code, notes, and snippets.

@MLWhiz
Last active September 7, 2020 16:10
Show Gist options
  • Save MLWhiz/c19a4c8ac50300d20dc313b88fc7f414 to your computer and use it in GitHub Desktop.
Save MLWhiz/c19a4c8ac50300d20dc313b88fc7f414 to your computer and use it in GitHub Desktop.
class myCustomNeuralNet(nn.Module):
def __init__(self):
super().__init__()
# Define all Layers Here
self.lin1 = myCustomLinearLayer(784,10)
def forward(self, x):
# Connect the layer Outputs here to define the forward pass
x = self.lin1(x)
return x
x = torch.randn((100,784))
model = myCustomNeuralNet()
model(x).size()
------------------------------------------
torch.Size([100, 10])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment