daily pastebin goal
26%
SHARE
TWEET

Untitled

a guest Nov 22nd, 2017 58 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class net(nn.Module):
  2.     def __init__(self):
  3.         super(net, self).__init__()
  4.         self.ln1 = nn.Linear(11,32,bias=False)
  5.         self.ln2 = nn.Linear(32,32,bias=False)
  6.         self.ln3 = nn.Linear(32,32,bias=False)
  7.         self.ln4 = nn.Linear(32,1,bias=False)
  8.         nninit.uniform(self.ln1.weight, a=-1,b=1)
  9.         nninit.uniform(self.ln2.weight,a=-1,b=1)
  10.         nninit.uniform(self.ln3.weight,a=-1,b=1)
  11.         nninit.uniform(self.ln4.weight,a=-1,b=1)
  12.         self.tanh1 = nn.Tanh()
  13.         self.tanh2 = nn.Tanh()
  14.         self.tanh3 = nn.Tanh()
  15.         self.sigmoid = nn.Sigmoid()
  16.     def forward(self,x):
  17.         U = self.ln1(x)
  18.         U = self.tanh1(U)
  19.         U = self.ln2(U)
  20.         U = self.tanh2(U)
  21.         U = self.ln3(U)
  22.         U = self.tanh3(U)
  23.         U = torch.sin(self.ln4(U))
  24.         return self.sigmoid(U)
  25. G = net()
RAW Paste Data
Top