A recurrent neural network layer for inference on Metal Performance Shaders images.


class MPSRNNImageInferenceLayer : MPSCNNKernel


The MPSRNNImageInferenceLayer specifies a recurrent neural network layer for inference on MPSImage objects. Two types of recurrent layers are supported:

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.


Inherits From

Conforms To

See Also

Recurrent Neural Networks

class MPSRNNMatrixInferenceLayer

A recurrent neural network layer for inference on Metal Performance Shaders matrices.

class MPSRNNSingleGateDescriptor

A description of a simple recurrent block or layer.

class MPSGRUDescriptor

A description of a gated recurrent unit block or layer.

class MPSLSTMDescriptor

A description of a long short-term memory block or layer.

enum MPSRNNSequenceDirection

Directions that a sequence of inputs can be processed by a recurrent neural network layer.

class MPSRNNMatrixTrainingLayer

A layer for training recurrent neural networks on Metal Performance Shaders matrices.

class MPSRNNMatrixTrainingState

A class that holds data from a forward pass to be used in a backward pass.