Contents

MLModelConfiguration

The settings for creating or updating a machine learning model.

Declaration

class MLModelConfiguration

Overview

Use a model configuration to:

  • Set or override model parameters.

  • Designate which device the model uses to make predictions, such as a GPU.

  • Restrict the model to use a specific computational device category, such as a CPU.

You typically use a model configuration instance to configure an MLModel instance as you create it with init(contentsOf:configuration:) or create an MLUpdateTask. See Personalizing a Model with On-Device Updates.

Configure your model parameters by setting values for each relevant MLParameterKey in the parameters property.

Topics

Configuring model parameters

Configuring GPU usage

Allowing access to processing units

Getting optimization hints

Initializers

See Also

Supporting types