Skip to content

Instantly share code, notes, and snippets.

@tonyroberts
Last active November 29, 2019 11:24
Show Gist options
  • Save tonyroberts/b292370a6a5698f4568a448ed9398e6a to your computer and use it in GitHub Desktop.
Save tonyroberts/b292370a6a5698f4568a448ed9398e6a to your computer and use it in GitHub Desktop.
class NN(nn.Module):
def __init__(self):
super(NN, self).__init__()
self.layers = nn.Sequential(nn.Linear(2, 128, bias=True),
nn.Tanh(),
nn.Linear(128, 64, bias=False),
nn.Tanh(),
nn.Linear(64, 32, bias=False),
nn.Tanh(),
nn.Linear(32, 16, bias=False),
nn.Tanh(),
nn.Linear(16, 8, bias=False),
nn.Tanh(),
nn.Linear(8, 4, bias=False),
nn.Tanh(),
nn.Linear(4, 3, bias=False),
nn.Sigmoid())
def forward(self, x):
return self.layers(x)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment