A description of a simple recurrent block or layer.
- iOS 11.0+
- macOS 10.13+
- Mac Catalyst 13.0+Beta
- tvOS 11.0+
- Metal Performance Shaders
The recurrent neural network (RNN) layer initialized with a
MPSRNNSingle transforms the input data (image or matrix) and previous output with a set of filters. Each produces one feature map in the new output data.
You may provide the RNN unit with a single input or a sequence of inputs.
Description of Operation
xbe the input data (at time index
jindex containing quadruplet: batch index,
x,yand feature index (
x = y = 0for matrices)).
h0be the recurrent input (previous output) data from previous time step (at time index
h1be the output data produced at this time step.
Wbe the weights for input and recurrent input data, respectively.
_ij, U _ij
bbe a bias term.
gi(x)be a neuron activation function.
The new output image
h1 data is computed as follows:
Summation is over index
j (except for the batch index), but there's no summation over repeated index
i (the output index).
Note that for validity, all intermediate images must be of same size, and the
U matrix must be square (that is,
input). Also, the bias terms are scalars with regard to spatial dimensions.