Created
June 8, 2019 19:14
-
-
Save vaibhavkumar049/ad15b797210521e050db9eb8fb563b6a 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
class FirstNetwork_v1(nn.Module): | |
def __init__(self): | |
super().__init__() | |
torch.manual_seed(0) | |
self.lin1 = nn.Linear(2, 2) | |
self.lin2 = nn.Linear(2, 4) | |
def forward(self, X): | |
a1 = self.lin1(X) | |
h1 = a1.sigmoid() | |
a2 = self.lin2(h1) | |
h2 = a2.exp()/a2.exp().sum(-1).unsqueeze(-1) | |
return h2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment