GRUCellLayer<T>
Layers · AiDotNet.NeuralNetworks.Layers
One step of a gated recurrent unit: h' = GRU(x, h), for recurrent decoders that run a step at a time.
Inheritance: LayerBase<T> → GRUCellLayer<T>
Implements: IShapeContract
For Beginners
A GRU keeps a running memory. Each step it decides how much of the old memory to keep and how much to overwrite with something computed from the new input.
How It Works
The gated recurrent unit of Cho et al. (2014) and Chung et al. (2014), with the reset gate applied to the state
before its projection (as TensorFlow’s GRUCell, which Tacotron’s implementations use):
Inputs: x``[batch, input] and h``[batch, hidden]; output [batch, hidden].
GRULayer runs a whole sequence; an autoregressive decoder (Tacotron’s attention and decoder RNNs)
needs each step’s state between steps, which this cell exposes.
Constructors
| Constructor | Summary |
|---|---|
GRUCellLayer(int inputSize, int hiddenSize) |
Creates a GRU cell. |
Properties
| Property | Summary |
|---|---|
bool RequiresMultipleInputs { get; } |
|
bool SupportsTraining { get; } |
|
int HiddenSize { get; } |
Width of the state. |
Methods
| Method | Summary |
|---|---|
IReadOnlyList<ILayer<T>> GetSubLayers() |
|
IReadOnlyList<OutputAxisContract> OutputAxesFor(int inputRank) |
|
Tensor<T> Forward(Tensor<T> input, Tensor<T> state) |
One step: the next state from the step input and the current state. |
void ResetState() |