Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class BasicRNNCell(RNNCell):
- """The most basic RNN cell.
- Args:
- num_units: int, The number of units in the RNN cell.
- activation: Nonlinearity to use. Default: `tanh`.
- reuse: (optional) Python boolean describing whether to reuse variables
- in an existing scope. If not `True`, and the existing scope already has
- the given variables, an error is raised.
- """
- def __init__(self, num_units, activation=None, reuse=None):
- super(BasicRNNCell, self).__init__(_reuse=reuse)
- self._num_units = num_units
- self._activation = activation or math_ops.tanh
- @property
- def state_size(self):
- return self._num_units
- @property
- def output_size(self):
- return self._num_units
- def call(self, inputs, state):
- """Most basic RNN: output = new_state = act(W * input + U * state + B)."""
- output = self._activation(_linear([inputs, state], self._num_units, True))
- return output, output
Add Comment
Please, Sign In to add comment