def add_simple_rnn(
        self,
        name,
        W_h,
        W_x,
        b,
        hidden_size,
        input_size,
        activation,
        input_names,
        output_names,
        output_all=False,
        reverse_input=False,
    ):
        """
        Add a simple recurrent layer to the model.
        Refer to the ``SimpleRecurrentLayerParams`` message in the specification
        (NeuralNetwork.proto) for more details.

        Parameters
        ----------
        name: str
            The name of this layer.
        W_h: numpy.array
            Weights of the recurrent layer's hidden state.
            Must be of shape ``(hidden_size, hidden_size)``.
        W_x: numpy.array
            Weights of the recurrent layer's input.
            Must be of shape ``(hidden_size, input_size)``.
        b: numpy.array or None
            Bias of the recurrent layer's output. If ``None``, bias is ignored.
            Otherwise it must be of shape ``(hidden_size, )``.
        hidden_size: int
            Number of hidden units. This is equal to the number of channels of output shape.
        input_size: int
            Number of the number of channels of input shape.
        activation: str
            Activation function name. Can be one of the following option:
            [``'RELU'``, ``'TANH'``, ``'SIGMOID'``, ``'SCALED_TANH'``, ``'SIGMOID_HARD'``, ``'LINEAR'``].
            See add_activation for more detailed description.
        input_names: list of str
            The input blob names list of this layer, in the order of ``[x, h_input]``.
        output_names: list of str
            The output blob names list of this layer, in the order of ``[y, h_output]``.
        output_all: boolean
            Whether the recurrent layer should output at every time step.

            - If False, the output is the result after the final state update.
            - If True, the output is a sequence, containing outputs at all time steps.

        reverse_input: boolean
            Whether the recurrent layer should process the input sequence in the reverse order.

            - If False, the input sequence order is not reversed.
            - If True, the input sequence order is reversed.

        See Also
        --------
        add_activation, add_gru, add_unilstm, add_bidirlstm
        """
        spec_layer = self._add_generic_layer(name, input_names, output_names)
        spec_layer_params = spec_layer.simpleRecurrent
        spec_layer_params.reverseInput = reverse_input

        # set the parameters
        spec_layer_params.inputVectorSize = input_size
        spec_layer_params.outputVectorSize = hidden_size
        if b is not None:
            spec_layer_params.hasBiasVector = True
        spec_layer_params.sequenceOutput = output_all

        activation_f = spec_layer_params.activation
        _set_recurrent_activation(activation_f, activation)

        # Write the weights
        spec_layer_params.weightMatrix.floatValue.extend(W_x.flatten())
        spec_layer_params.recursionMatrix.floatValue.extend(W_h.flatten())

        if b is not None:
            spec_layer_params.biasVector.floatValue.extend(b.flatten())
        return spec_layer

        Add a simple recurrent layer to the model.
        Refer to the ``SimpleRecurrentLayerParams`` message in the specification
        (NeuralNetwork.proto) for more details.

        Parameters
        ----------
        name: str
            The name of this layer.
        W_h: numpy.array
            Weights of the recurrent layer's hidden state.
            Must be of shape ``(hidden_size, hidden_size)``.
        W_x: numpy.array
            Weights of the recurrent layer's input.
            Must be of shape ``(hidden_size, input_size)``.
        b: numpy.array or None
            Bias of the recurrent layer's output. If ``None``, bias is ignored.
            Otherwise it must be of shape ``(hidden_size, )``.
        hidden_size: int
            Number of hidden units. This is equal to the number of channels of output shape.
        input_size: int
            Number of the number of channels of input shape.
        activation: str
            Activation function name. Can be one of the following option:
            [``'RELU'``, ``'TANH'``, ``'SIGMOID'``, ``'SCALED_TANH'``, ``'SIGMOID_HARD'``, ``'LINEAR'``].
            See add_activation for more detailed description.
        input_names: list of str
            The input blob names list of this layer, in the order of ``[x, h_input]``.
        output_names: list of str
            The output blob names list of this layer, in the order of ``[y, h_output]``.
        output_all: boolean
            Whether the recurrent layer should output at every time step.

            - If False, the output is the result after the final state update.
            - If True, the output is a sequence, containing outputs at all time steps.

        reverse_input: boolean
            Whether the recurrent layer should process the input sequence in the reverse order.

            - If False, the input sequence order is not reversed.
            - If True, the input sequence order is reversed.

        See Also
        --------
        add_activation, add_gru, add_unilstm, add_bidirlstm
        
coremltools/models/neural_network/builder.py