Guest User

Untitled

a guest
Mar 17th, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. Class Net(nn.module):
  2. self.depth = 5
  3. self.hidden_width = 100
  4.  
  5. drnn_h = [Variable(torch.zeros(2 ** i, 1, self.hidden_width)).cuda().float()
  6. for i in range(self.depth)]
  7.  
  8. self.drnn1 = drnn.DRNN(self.hidden_width, self.hidden_width, self.depth)
  9. ...
  10. ...
  11.  
  12. def process(self, input):
  13. input = self.io_noise(input)
  14. lin_1 = self.lin1(input).view(1, 1, self.hidden_width)
  15. drnn_out, self.drnn_h = self.drnn1(lin_1, self.drnn_h)
  16. drnn_out = drnn_out.view(1, self.hidden_width)
  17. output = self.lin2(drnn_out).view(1, 1, self.io_width)
  18. return output
  19.  
  20. DRNN (5 layer, 100 wide, with memory)
  21. Avg GPU Memory Allocation: 1102 MB
  22. Avg Iteration time: 43.842 sec
Add Comment
Please, Sign In to add comment