class_docstr: lasagne.layers.recurrent.RecurrentLayer(incoming, num_units,
  W_in_to_hid=lasagne.init.Uniform(), W_hid_to_hid=lasagne.init.Uniform(),
  b=lasagne.init.Constant(0.), nonlinearity=lasagne.nonlinearities.rectify,
  hid_init=lasagne.init.Constant(0.), backwards=False, learn_init=False,
  gradient_steps=-1, grad_clipping=0, unroll_scan=False,
  precompute_input=True, mask_input=None, only_return_final=False, **kwargs)
  
  Dense recurrent neural network (RNN) layer
  
  A "vanilla" RNN layer, which has dense input-to-hidden and
  hidden-to-hidden connections.  The output is computed as
  
  .. math ::
      h_t = \sigma(x_t W_x + h_{t-1} W_h + b)
  
  Parameters
  ----------
  incoming : a :class:`lasagne.layers.Layer` instance or a tuple
      The layer feeding into this layer, or the expected input shape.
  num_units : int
      Number of hidden units in the layer.
  W_in_to_hid : Theano shared variable, numpy array or callable
      Initializer for input-to-hidden weight matrix (:math:`W_x`).
  W_hid_to_hid : Theano shared variable, numpy array or callable
      Initializer for hidden-to-hidden weight matrix (:math:`W_h`).
  b : Theano shared variable, numpy array, callable or None
      Initializer for bias vector (:math:`b`). If None is provided there will
      be no bias.
  nonlinearity : callable or None
      Nonlinearity to apply when computing new state (:math:`\sigma`). If
      None is provided, no nonlinearity will be applied.
  hid_init : callable, np.ndarray, theano.shared or :class:`Layer`
      Initializer for initial hidden state (:math:`h_0`).
  backwards : bool
      If True, process the sequence backwards and then reverse the
      output again such that the output from the layer is always
      from :math:`x_1` to :math:`x_n`.
  learn_init : bool
      If True, initial hidden values are learned.
  gradient_steps : int
      Number of timesteps to include in the backpropagated gradient.
      If -1, backpropagate through the entire sequence.
  grad_clipping : float
      If nonzero, the gradient messages are clipped to the given value during
      the backward pass.  See [1]_ (p. 6) for further explanation.
  unroll_scan : bool
      If True the recursion is unrolled instead of using scan. For some
      graphs this gives a significant speed up but it might also consume
      more memory. When `unroll_scan` is True, backpropagation always
      includes the full sequence, so `gradient_steps` must be set to -1 and
      the input sequence length must be known at compile time (i.e., cannot
      be given as None).
  precompute_input : bool
      If True, precompute input_to_hid before iterating through
      the sequence. This can result in a speedup at the expense of
      an increase in memory usage.
  mask_input : :class:`lasagne.layers.Layer`
      Layer which allows for a sequence mask to be input, for when sequences
      are of variable length.  Default `None`, which means no mask will be
      supplied (i.e. all sequences are of the same length).
  only_return_final : bool
      If True, only return the final sequential output (e.g. for tasks where
      a single target value for the entire sequence is desired).  In this
      case, Theano makes an optimization which saves memory.
  
  References
  ----------
  .. [1] Graves, Alex: "Generating sequences with recurrent neural networks."
         arXiv preprint arXiv:1308.0850 (2013).
code: def __init__(
      self,
      incoming,
      num_units,
      W_in_to_hid=init.Uniform(),
      W_hid_to_hid=init.Uniform(),
      b=init.Constant(0.0),
      nonlinearity=nonlinearities.rectify,
      hid_init=init.Constant(0.0),
      backwards=False,
      learn_init=False,
      gradient_steps=-1,
      grad_clipping=0,
      unroll_scan=False,
      precompute_input=True,
      mask_input=None,
      only_return_final=False,
      **kwargs,
  ):
      if isinstance(incoming, tuple):
          input_shape = incoming
      else:
          input_shape = incoming.output_shape
      # Retrieve the supplied name, if it exists; otherwise use ''
      if "name" in kwargs:
          basename = kwargs["name"] + "."
          # Create a separate version of kwargs for the contained layers
          # which does not include 'name'
          layer_kwargs = dict(
              (key, arg) for key, arg in kwargs.items() if key != "name"
          )
      else:
          basename = ""
          layer_kwargs = kwargs
      # We will be passing the input at each time step to the dense layer,
      # so we need to remove the second dimension (the time dimension)
      in_to_hid = DenseLayer(
          InputLayer((None,) + input_shape[2:]),
          num_units,
          W=W_in_to_hid,
          b=b,
          nonlinearity=None,
          name=basename + "input_to_hidden",
          **layer_kwargs,
      )
      # The hidden-to-hidden layer expects its inputs to have num_units
      # features because it recycles the previous hidden state
      hid_to_hid = DenseLayer(
          InputLayer((None, num_units)),
          num_units,
          W=W_hid_to_hid,
          b=None,
          nonlinearity=None,
          name=basename + "hidden_to_hidden",
          **layer_kwargs,
      )
  
      # Make child layer parameters intuitively accessible
      self.W_in_to_hid = in_to_hid.W
      self.W_hid_to_hid = hid_to_hid.W
      self.b = in_to_hid.b
  
      # Just use the CustomRecurrentLayer with the DenseLayers we created
      super(RecurrentLayer, self).__init__(
          incoming,
          in_to_hid,
          hid_to_hid,
          nonlinearity=nonlinearity,
          hid_init=hid_init,
          backwards=backwards,
          learn_init=learn_init,
          gradient_steps=gradient_steps,
          grad_clipping=grad_clipping,
          unroll_scan=unroll_scan,
          precompute_input=precompute_input,
          mask_input=mask_input,
          only_return_final=only_return_final,
          **kwargs,
      )
  
imports: import numpy
  import theano
  import theano.tensor
  from ..None import nonlinearities
  from ..None import init
  from ..utils import unroll_scan
  from .base import MergeLayer, Layer
  from .input import InputLayer
  from .dense import DenseLayer
  from .None import helper
label_desc: Use image node_id 1 to create a new RecurrentLayer object from inherited base classes: CustomRecurrentLayer with example: obj = RecurrentLayer(incoming, num_units, W_in_to_hid, W_hid_to_hid, b, nonlinearity, hid_init, backwards, learn_init, gradient_steps, grad_clipping, unroll_scan, precompute_input, mask_input, only_return_final)