Protocol

MLCustomModel

An interface that defines the behavior of a custom model.

Overview

Use the MLCustomModel protocol to define the behavior of a custom Core ML model.

Topics

Creating the Model

init(modelDescription: MLModelDescription, parameters: [String : Any])

Creates a custom model with the given description and parameters.

Required.

Making Predictions

func prediction(from: MLFeatureProvider, options: MLPredictionOptions) -> MLFeatureProvider

Predicts output values from the given input features.

Required.

func predictions(from: MLBatchProvider, options: MLPredictionOptions) -> MLBatchProvider

Predicts output values from the given batch of input features.

See Also

Customization

Integrating Custom Layers

Integrate custom neural network layers into your Core ML app.

Creating a Custom Layer

Make your own custom layer for Core ML models.

protocol MLCustomLayer

An interface that defines the behavior of a custom layer in your neural network model.