Files
openvino/docs/ops/sequence/RNNCell_3.md
Tatiana Savina b3ea6ceefa DOCS shift to rst - Opset R (#17159)
* ops to rst

* sphinx transition

* try html tag

* try comment

* try code directive

* try code directive

* try highlight

* try concole directive

* try line directive

* add highlight for code

* another directive

* introduce consoke directive

* add code format
2023-04-24 11:02:09 +02:00

3.1 KiB

RNNCell

@sphinxdirective

Versioned name: RNNCell-3

Category: Sequence processing

Short description: RNNCell represents a single RNN cell that computes the output using the formula described in the article <https://hackernoon.com/understanding-architecture-of-lstm-cell-from-scratch-with-code-8da40f0b71f4>__.

Detailed description:

RNNCell represents a single RNN cell and is part of :doc:RNNSequence <openvino_docs_ops_sequence_RNNSequence_5> operation.

.. code-block:: cpp

Formula: * - matrix multiplication ^T - matrix transpose f - activation function Ht = f(Xt*(Wi^T) + Ht-1*(Ri^T) + Wbi + Rbi)

Attributes

  • hidden_size

    • Description: hidden_size specifies hidden state size.
    • Range of values: a positive integer
    • Type: int
    • Required: yes
  • activations

    • Description: activation functions for gates
    • Range of values: any combination of relu, sigmoid, tanh
    • Type: a list of strings
    • Default value: tanh
    • Required: no
  • activations_alpha, activations_beta

    • Description: activations_alpha, activations_beta functions attributes
    • Range of values: a list of floating-point numbers
    • Type: float[]
    • Default value: None
    • Required: no
  • clip

    • Description: clip specifies value for tensor clipping to be in [-C, C] before activations
    • Range of values: a positive floating-point number
    • Type: float
    • Default value: infinity that means that the clipping is not applied
    • Required: no

Inputs

  • 1: X - 2D tensor of type T [batch_size, input_size], input data. Required.

  • 2: H - 2D tensor of type T [batch_size, hidden_size], initial hidden state. Required.

  • 3: W - 2D tensor of type T [hidden_size, input_size], the weights for matrix multiplication. Required.

  • 4: R - 2D tensor of type T [hidden_size, hidden_size], the recurrence weights for matrix multiplication. Required.

  • 5: B 1D tensor of type T [hidden_size], the sum of biases (weights and recurrence weights). Required.

Outputs

  • 1: Ho - 2D tensor of type T [batch_size, hidden_size], the last output value of hidden state.

Types

  • T: any supported floating-point type.

Example

.. code-block:: cpp

<layer ... type="RNNCell" ...> 1 16 1 128 128 16 128 128 128 1 128

@endsphinxdirective