Single layer RNN.
SingleLayerRNN
01 Syntax
02 Methods
| Name | Overloads | Summary |
|---|---|---|
| .ctor | 2 | Creates a net with default parameters. |
| initialize | 1 | Initializes the network for the given vocabulary size. |
| forwardBackward | 1 | Performs a forward-backward pass for the given token indices. |
| sampleIndices | 2 | Samples n indices, optionally advancing the hidden state. |
03 Properties
| Name | Overloads | Summary |
|---|---|---|
| HiddenSize | 1 | Sets the hidden layer size. |
| LearningRate | 1 | Sets the learning rate of the single layer. |
| Initialized | 1 | Gets a value indicating whether the network has been initialized. |
| VocabularySize | 1 | Gets the vocabulary size, i.e. |
04 Fields
| Name | Overloads | Summary |
|---|---|---|
| layer | 1 | The single RNN layer |
05 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 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.
| 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.
| 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.
| 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. The network must be initialized again afterwards.
Sets the learning rate of the single layer.
Gets a value indicating whether the network has been initialized.
Gets the vocabulary size, i.e. the maximum index plus one.
The single RNN layer