Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #building а neural network
- class Net(torch.nn.Module):
- def __init__(self):
- super(Net, self).__init__()
- self.hiddenLayerOne = torch.nn.Linear(2,32) #creates linear transformation
- self.m=torch.nn.Sigmoid() #and puts it trough activation
- self.hiddenLayerTwo = torch.nn.Linear(32,32) #function
- self.output = torch.nn.Linear(32,2)
- def forward(self, x):
- x = self.hiddenLayerOne(x)
- x= self.m(x)
- x= self.hiddenLayerTwo(x)
- x = self.output(x) #passing x trough operations
- return x
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement