Skip to content

Commit

Permalink
Initialize attention vector
Browse files Browse the repository at this point in the history
  • Loading branch information
thomwolf committed Sep 3, 2018
1 parent 674ef4b commit aa5818a
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions torchmoji/attlayer.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ def __init__(self, attention_size, return_attention=False):
self.return_attention = return_attention
self.attention_size = attention_size
self.attention_vector = Parameter(torch.FloatTensor(attention_size))
self.attention_vector.data.normal_(std=0.05) # Initialize attention vector

def __repr__(self):
s = '{name}({attention_size}, return attention={return_attention})'
Expand Down

0 comments on commit aa5818a

Please sign in to comment.