<!--
{
  "availability" : [
    "iOS: 15.0.0 -",
    "iPadOS: 15.0.0 -",
    "macCatalyst: 15.0.0 -",
    "macOS: 11.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CreateML",
  "identifier" : "/documentation/CreateML/MLStyleTransfer/ModelParameters/algorithm",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "Create ML"
    ],
    "preciseIdentifier" : "s:8CreateML15MLStyleTransferV15ModelParametersV9algorithmAE0E13AlgorithmTypeOvp"
  },
  "title" : "algorithm"
}
-->

# algorithm

The style transfer task’s training algorithm that prioritizes either speed or quality.

```
var algorithm: MLStyleTransfer.ModelParameters.ModelAlgorithmType
```

## Discussion

You choose the task’s training algorithm based on your intended use for this model.

Use [`MLStyleTransfer.ModelParameters.ModelAlgorithmType.cnnLite`](/documentation/CreateML/MLStyleTransfer/ModelParameters/ModelAlgorithmType/cnnLite) to train a model that prioritizes speed
to stylize images with low latency, typically for frames of a video stream. Otherwise, select
[`MLStyleTransfer.ModelParameters.ModelAlgorithmType.cnn`](/documentation/CreateML/MLStyleTransfer/ModelParameters/ModelAlgorithmType/cnn) to train a model that applies a higher-quality
stylization, typically for a still image.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)