Class

MPSRNNImageInferenceLayer

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

Declaration

@interface MPSRNNImageInferenceLayer : MPSCNNKernel

Overview

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.

Relationships

Inherits From

See Also

Recurrent Neural Networks

MPSRNNMatrixInferenceLayer

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

MPSRNNSingleGateDescriptor

A description of a simple recurrent block or layer.

MPSGRUDescriptor

A description of a gated recurrent unit block or layer.

MPSLSTMDescriptor

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

MPSRNNSequenceDirection

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

MPSRNNMatrixTrainingLayer

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

MPSRNNMatrixTrainingState

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