MPSRNNSingleGateDescriptor
A description of a simple recurrent block or layer.
Declaration
class MPSRNNSingleGateDescriptorOverview
The recurrent neural network (RNN) layer initialized with a MPSRNNSingleGateDescriptor 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
Let
x_jbe the input data (at time indextof sequence,jindex containing quadruplet: batch index,x,yand feature index (x = y = 0for matrices)).Let
h0_jbe the recurrent input (previous output) data from previous time step (at time indext-1of sequence).Let
h1_ibe the output data produced at this time step.Let
W_ij, U_ijbe the weights for input and recurrent input data, respectively.Let
b_ibe a bias term.Let
gi(x)be a neuron activation function.
The new output image h1_i data is computed as follows:
h1_i = gi( W_ij * x_j + U_ij * h0_j + b_i )The * stands for convolution (see MPSRNNImageInferenceLayer) or matrix-vector/matrix multiplication (see MPSRNNMatrixInferenceLayer).
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, outputFeatureChannels == inputFeatureChannels). Also, the bias terms are scalars with regard to spatial dimensions.