Skip to content

Commit

Permalink
Merge pull request #7 from mkudinov/feature-bugfix-implicit-casting
Browse files Browse the repository at this point in the history
Bugfix: implicit casting int64 + float32 used to cause a type error. Cas...
  • Loading branch information
kyunghyuncho committed Oct 22, 2014
2 parents da5ae37 + 457bf0f commit 3691cbf
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions groundhog/layers/rec_layers.py
Expand Up @@ -229,6 +229,7 @@ def step_fprop(self,
W_hhs = self.W_hhs
b_hhs = self.b_hhs
preactiv = TT.dot(state_before, W_hhs[0]) +state_below
preactiv = TT.cast(preactiv,theano.config.floatX)
h = self.activation[0](preactiv)
if self.activ_noise and use_noise:
h = h + self.trng.normal(h.shape, avg=0, std=self.activ_noise, dtype=h.dtype)
Expand Down Expand Up @@ -1065,6 +1066,7 @@ def step_fprop(self,
else:
state_before_ = state_before
preactiv = TT.dot(state_before_, W_hh) + state_below
preactiv = TT.cast(preactiv,theano.config.floatX)
h = self.activation(preactiv)
if self.gating and gater_below:
gater = self.gater_activation(TT.dot(state_before, G_hh) +
Expand Down

0 comments on commit 3691cbf

Please sign in to comment.