Multi layer RNN: a stack of RNNLayer instances where the output of one layer feeds the next.
MultiLayerRNN
01 Syntax
02 Methods
| Name | Overloads | Summary |
|---|---|---|
| .ctor | 2 | Creates a net with default parameters. |
| initialize | 1 | Initializes the network and creates the stacked layers for the given vocabulary size. |
| forwardBackward | 1 | Performs a forward-backward pass for the given token indices through all stacked layers. |
| sampleIndices | 2 | Samples n indices, optionally advancing the hidden state of every layer. |
03 Properties
| Name | Overloads | Summary |
|---|---|---|
| HiddenSize | 1 | Sets the hidden layer size of every RNN layer. |
| LearningRate | 1 | Sets the learning rate of every layer. |
| Initialized | 1 | Returns true if the net was initialized. |
| VocabularySize | 1 | Returns the vocabulary size - max index + 1. |
04 Members
Creates a net with default parameters.
Int32)Creates a net with default parameters and initializes it immediately.
| Name | Type | Description |
|---|---|---|
vocabularySize | Int32 | The vocabulary size; it must be greater than zero. |
Int32)Initializes the network and creates the stacked layers for the given vocabulary size.
| Name | Type | Description |
|---|---|---|
vocabularySize | Int32 | The vocabulary size; it must be greater than zero. |
Int32(), Int32())Performs a forward-backward pass for the given token indices through all stacked layers.
| Name | Type | Description |
|---|---|---|
ix | Int32() | The input indices; its length must match iy and must not be empty. |
iy | Int32() | The target indices; every index must be smaller than the vocabulary size. |
The cross-entropy loss of this sequence.
Int32, Int32(), Double)Samples n indices, advancing the hidden state of every layer.
| Name | Type | Description |
|---|---|---|
n | Int32 | Number of indices to sample. |
seed | Int32() | The seed indices. |
temp | Double | Sampling temperature in |
The sampled indices.
Int32, Int32(), Double, Boolean)Samples n indices, optionally advancing the hidden state of every layer.
| Name | Type | Description |
|---|---|---|
n | Int32 | Number of indices to sample. |
seed | Int32() | The seed indices. |
temp | Double | Sampling temperature in |
advance | Boolean | When |
The sampled indices.
Sets the hidden layer size of every RNN layer. The network must be initialized again afterwards.
The array must not be empty and every size must be greater than one.
Sets the learning rate of every layer.
Returns true if the net was initialized.
Returns the vocabulary size - max index + 1.