Advertisement
Guest User

Untitled

a guest
Jan 25th, 2020
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.62 KB | None | 0 0
  1. #building а neural network
  2. class Net(torch.nn.Module):
  3.     def __init__(self):
  4.         super(Net, self).__init__()
  5.         self.hiddenLayerOne = torch.nn.Linear(2,32)      #creates linear transformation
  6.         self.m=torch.nn.Sigmoid()                        #and puts it trough activation
  7.         self.hiddenLayerTwo = torch.nn.Linear(32,32)     #function
  8.         self.output = torch.nn.Linear(32,2)
  9.  
  10.     def forward(self, x):
  11.         x = self.hiddenLayerOne(x)
  12.         x= self.m(x)
  13.         x= self.hiddenLayerTwo(x)
  14.         x = self.output(x)                               #passing x trough operations
  15.         return x
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement