class_docstr: Recurrent Neural Network (RNN) block.
docstr: Creates an RNN instance.
  
  Args:
      nstate: number of hidden units.
      nin: number of input units.
      nout: number of output units.
      activation: actication function for hidden layer.
      w_init: weight initializer for RNN model weights.
code: def __init__(
      self,
      nstate: int,
      nin: int,
      nout: int,
      activation: Callable = jn.tanh,
      w_init: Callable = kaiming_normal,
  ):
      """Creates an RNN instance.
  
      Args:
          nstate: number of hidden units.
          nin: number of input units.
          nout: number of output units.
          activation: actication function for hidden layer.
          w_init: weight initializer for RNN model weights.
      """
      self.num_inputs = nin
      self.num_outputs = nout
      self.nstate = nstate
      self.activation = activation
  
      # Hidden layer parameters
      self.w_xh = TrainVar(w_init((self.num_inputs, self.nstate)))
      self.w_hh = TrainVar(w_init((self.nstate, self.nstate)))
      self.b_h = TrainVar(jn.zeros(self.nstate))
  
      self.output_layer = Linear(self.nstate, self.num_outputs)
  
file_path: objax/objax/zoo/rnn.py
imports: from typing import Callable
  import jax.numpy
  from objax import Module
  from objax.nn import Linear
  from objax.nn.init import kaiming_normal
  from objax.typing import JaxArray
  from objax.variable import TrainVar, StateVar
label_desc: Use image node_id 1 to create a new RNN object from inherited base classes: Module with example: obj = RNN(nstate, nin, nout, activation, w_init)