Skip to content

Commit

Permalink
Update attention_keras.py
Browse files Browse the repository at this point in the history
  • Loading branch information
bojone authored Jul 27, 2019
1 parent b7415c9 commit d7dba33
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion attention_keras.py
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@ def call(self, inputs):
def idx2pos(self, pid):
pid = K.cast(pid, 'float32')
pid = K.expand_dims(pid, 2)
pj = 1. / K.pow(10000, 2. / self.v_dim * K.arange(self.v_dim // 2, dtype='float32'))
pj = 1. / K.pow(10000., 2. / self.v_dim * K.arange(self.v_dim // 2, dtype='float32'))
pj = K.expand_dims(pj, 0)
pv = K.dot(pid, pj)
pv1, pv2 = K.sin(pv), K.cos(pv)
Expand Down

0 comments on commit d7dba33

Please sign in to comment.