Skip to content

Commit

Permalink
Upload Pytorch implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
daiquocnguyen authored Jun 6, 2020
1 parent 6043353 commit 9d601f8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions RMeN_pytorch/RMeN.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,12 @@ def forward(self):
l2_reg = l2_reg + W.norm(2)
for W in self.transformer_rel_rnn.parameters():
l2_reg = l2_reg + W.norm(2)
# for W in self.pos_h:
# l2_reg = l2_reg + W.norm(2)
# for W in self.pos_r:
# l2_reg = l2_reg + W.norm(2)
# for W in self.pos_t:
# l2_reg = l2_reg + W.norm(2)


return self.loss(score, l2_reg)
Expand Down
2 changes: 1 addition & 1 deletion RMeN_pytorch/relational_rnn_general.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import torch.nn.functional as F
import numpy as np

"""This implementation is taken from https://github.com/L0SG/relational-rnn-pytorch/"""
"""This file is taken from https://github.com/L0SG/relational-rnn-pytorch/blob/master/relational_rnn_general.py"""

# this class largely follows the official sonnet implementation
# https://github.com/deepmind/sonnet/blob/master/sonnet/python/modules/relational_memory.py
Expand Down

0 comments on commit 9d601f8

Please sign in to comment.