Skip to content

Commit

Permalink
nematus cell is child of grucell not orthogrucell
Browse files Browse the repository at this point in the history
  • Loading branch information
varisd committed Nov 21, 2017
1 parent 1f68eb5 commit 0186206
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions neuralmonkey/nn/ortho_gru_cell.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def __call__(self, inputs, state, scope="OrthoGRUCell"):


# Note that tensorflow does not like when the type annotations are present.
class NematusGRUCell(OrthoGRUCell):
class NematusGRUCell(tf.contrib.rnn.GRUCell):
"""Nematus implementation of gated recurrent unit cell.
The main difference is the order in which the gating functions and linear
Expand All @@ -28,11 +28,12 @@ class NematusGRUCell(OrthoGRUCell):
The math is equivalent, in practice there are differences due to float
precision errors.
"""

def __init__(self, rnn_size, use_state_bias=False, use_input_bias=True):
self.use_state_bias = use_state_bias
self.use_input_bias = use_input_bias

OrthoGRUCell.__init__(self, rnn_size)
tf.contrib.rnn.GRUCell.__init__(self, rnn_size)

def call(self, inputs, state):
"""Gated recurrent unit (GRU) with nunits cells."""
Expand Down

0 comments on commit 0186206

Please sign in to comment.