Class

MPSRNNMatrixInferenceLayer

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

Declaration

class MPSRNNMatrixInferenceLayer : MPSKernel

Overview

The MPSRNNMatrixInferenceLayer specifies a recurrent neural network layer for inference on MPSMatrix 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.

MPSRNNMatrixInferenceLayer 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

Conforms To

See Also

Recurrent Neural Networks

class MPSRNNImageInferenceLayer

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

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.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software