def _step(self, m, y, h_, Ur):
'''Step function for RNN call.
Args:
m (T.tensor): masks.
y (T.tensor): inputs.
h_ (T.tensor): recurrent state.
Ur (theano.shared): recurrent connection.
Returns:
T.tensor: next recurrent state.
'''
preact = T.dot(h_, Ur) + y
h = T.tanh(preact)
h = m * h + (1 - m) * h_
return h
评论列表
文章目录