Created
June 8, 2019 09:10
-
-
Save vaibhavkumar049/6421cb92988262ffbe51f6b0fd101ca9 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
def model(x): | |
a1 = torch.matmul(x, weights1) + bias1 # (N, 2) x (2, 2) -> (N, 2) | |
h1 = a1.sigmoid() # (N, 2) | |
a2 = torch.matmul(h1, weights2) + bias2 # (N, 2) x (2, 4) -> (N, 4) | |
h2 = a2.exp()/a2.exp().sum(-1).unsqueeze(-1) # (N, 4) | |
return h2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment