Contents

MLParameterKey

The keys for the parameter dictionary in a model configuration or a model update context.

Declaration

class MLParameterKey

Overview

Use an MLParameterKey to retrieve a model’s parameter value using:

Overriding model and layer parameters

To override a model’s default parameter values:

  1. Create an MLModelConfiguration instance.

  2. Use an MLParameterKey for each parameter to set its value in the model configuration’s parameters dictionary.

  3. Create a new model instance using init(contentsOf:configuration:) with your custom model configuration.

Configuring update parameters

To configure the update parameters for an MLUpdateTask:

  1. Create an MLModelConfiguration instance.

  2. Use an MLParameterKey for each parameter to set its value in the model configuration’s parameters dictionary.

  3. Create a new update task with your custom model configuration.

See Personalizing a Model with On-Device Updates.

Topics

Scoping parameter keys

Accessing model parameters

Accessing neural network layer parameters

Accessing model update parameters

See Also

Inspecting a model