Skip to content

Instantly share code, notes, and snippets.

@conormm
Created May 3, 2018 21:58
Show Gist options
  • Save conormm/4582e52523f96157d62f033b8f8c8481 to your computer and use it in GitHub Desktop.
Save conormm/4582e52523f96157d62f033b8f8c8481 to your computer and use it in GitHub Desktop.
class MoonsModel(nn.Module):
def __init__(self, n_features, n_neurons):
super(MoonsModel, self).__init__()
self.hidden = nn.Linear(in_features=n_features, out_features=n_neurons)
self.out_layer = nn.Linear(in_features=n_neurons, out_features=2)
def forward(self, X):
out = F.relu(self.hidden(X))
out = F.sigmoid(self.out_layer(out))
return out
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment