MPSRNNImageInferenceLayer
A recurrent neural network layer for inference on Metal Performance Shaders images.
Declaration
class MPSRNNImageInferenceLayerOverview
The MPSRNNImageInferenceLayer specifies a recurrent neural network layer for inference on MPSImage objects. Two types of recurrent layers are supported:
MPSRNNImageInferenceLayer—Operates with convolutions on images.
MPSRNNMatrixInferenceLayer—Operates on matrices.
You can use MPSRNNImageInferenceLayer to implement the latter by using 1 x 1 images, but due to image size restrictions and performance, MPSRNNMatrixInferenceLayer is the better choice for linear recurrent layers.
MPSRNNImageInferenceLayer is initialized using either of the following:
A single MPSRNNDescriptor instance, which further specifies the recurrent network layer.
An array of MPSRNNDescriptor instances, which specifies a stack of recurrent layers that can operate in parallel a subset of the inputs in a sequence of inputs and recurrent outputs.
Stacks with bidirectionally traversing encode functions don’t support starting from a previous set of recurrent states. However, you can achieve this effect by defining two separate unidirectional stacks of layers, running the same input sequence on them separately (one forward and one backward), and ultimately combining the two result sequences.
Topics
Initializers
Instance Properties
bidirectionalCombineModeMPSRNNBidirectionalCombineModenumberOfLayersrecurrentOutputIsTemporarystoreAllIntermediateStatesinputFeatureChannelsoutputFeatureChannels