Skip to content

Commit f06aa99

Browse files
songbelltsavina
andauthored
revise RNN spec (openvinotoolkit#8081)
* revise RNN spec Signed-off-by: fishbell <[email protected]> * formatting the formula Signed-off-by: fishbell <[email protected]> * Update docs/ops/sequence/RNNSequence_5.md Co-authored-by: Tatiana Savina <[email protected]> Co-authored-by: Tatiana Savina <[email protected]>
1 parent 24675fd commit f06aa99

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

docs/ops/sequence/RNNCell_3.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,18 @@
66

77
**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).
88

9+
**Detailed description**:
10+
11+
*RNNCell* represents a single RNN cell and is part of [RNNSequence](RNNSequence_5.md) operation.
12+
13+
```
14+
Formula:
15+
* - matrix multiplication
16+
^T - matrix transpose
17+
f - activation function
18+
Ht = f(Xt*(Wi^T) + Ht-1*(Ri^T) + Wbi + Rbi)
19+
```
20+
921
**Attributes**
1022

1123
* *hidden_size*
@@ -43,7 +55,7 @@
4355

4456
* **1**: `X` - 2D tensor of type *T* `[batch_size, input_size]`, input data. **Required.**
4557

46-
* **2**: `initial_hidden_state` - 2D tensor of type *T* `[batch_size, hidden_size]`. **Required.**
58+
* **2**: `H` - 2D tensor of type *T* `[batch_size, hidden_size]`, initial hidden state. **Required.**
4759

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

docs/ops/sequence/RNNSequence_5.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ A single cell in the sequence is implemented in the same way as in <a href="#RNN
4646

4747
* *direction*
4848

49-
* **Description**: Specify if the RNN is forward, reverse, or bidirectional. If it is one of *forward* or *reverse* then `num_directions = 1`, if it is *bidirectional*, then `num_directions = 2`. This `num_directions` value specifies input/output shape requirements.
49+
* **Description**: Specify if the RNN is forward, reverse, or bidirectional. If it is one of *forward* or *reverse*, then `num_directions = 1`. If it is *bidirectional*, then `num_directions = 2`. This `num_directions` value specifies input/output shape requirements. When the operation is bidirectional, the input goes through forward and reverse ways. The outputs are concatenated.
5050
* **Range of values**: *forward*, *reverse*, *bidirectional*
5151
* **Type**: `string`
5252
* **Required**: *yes*
@@ -55,7 +55,7 @@ A single cell in the sequence is implemented in the same way as in <a href="#RNN
5555

5656
* **1**: `X` - 3D tensor of type *T1* `[batch_size, seq_length, input_size]`, input data. It differs from RNNCell 1st input only by additional axis with size `seq_length`. **Required.**
5757

58-
* **2**: `initial_hidden_state` - 3D tensor of type *T1* `[batch_size, num_directions, hidden_size]`, input hidden state data. **Required.**
58+
* **2**: `H` - 3D tensor of type *T1* `[batch_size, num_directions, hidden_size]`, input hidden state data. **Required.**
5959

6060
* **3**: `sequence_lengths` - 1D tensor of type *T2* `[batch_size]`, specifies real sequence lengths for each batch element. **Required.**
6161

0 commit comments

Comments
 (0)