<!--
{
  "availability" : [
    "iOS: 15.0.0 -",
    "iPadOS: 15.0.0 -",
    "macCatalyst: 15.0.0 -",
    "macOS: 11.0.0 -",
    "tvOS: 16.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CreateML",
  "identifier" : "/documentation/CreateML/MLProgress",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "Create ML"
    ],
    "preciseIdentifier" : "s:8CreateML10MLProgressV"
  },
  "title" : "MLProgress"
}
-->

# MLProgress

A convenience type that exposes information about the progress of a training
session.

```
struct MLProgress
```

## Overview

Create ML uses this type to exposes specific values within a *Progress*
instance as properties.

## Topics

### Creating a training progress update

[`init(phase: MLPhase)`](/documentation/CreateML/MLProgress/init(phase:))

Creates a training session progress instance from a training phase.

[`init?(progress: Progress)`](/documentation/CreateML/MLProgress/init(progress:))

Creates a training session progress instance from a foundation progress
object.

### Inspecting a session’s progress

[`var elapsedTime: TimeInterval`](/documentation/CreateML/MLProgress/elapsedTime)

The time, in seconds, since the training session started.

[`var phase: MLPhase`](/documentation/CreateML/MLProgress/phase)

The current phase of the training session.

[`var itemCount: Int`](/documentation/CreateML/MLProgress/itemCount)

The current number of files processed during a feature extraction phase,
or the completed iterations during a training phase.

[`var totalItemCount: Int?`](/documentation/CreateML/MLProgress/totalItemCount)

The total number of files during a feature extraction phase, or total
iterations during a training phase.

[`var metrics: [MLProgress.Metric : Any]`](/documentation/CreateML/MLProgress/metrics)

Measurements of the model’s performance during the training or
evaluation phases of a training session.

[`enum Metric`](/documentation/CreateML/MLProgress/Metric)

Metrics you use to evaluate a model’s performance during a training
session.

### Accessing general information

[`static let elapsedTimeKey: ProgressUserInfoKey`](/documentation/CreateML/MLProgress/elapsedTimeKey)

The key that accesses the elapsed time value.

[`static let phaseKey: ProgressUserInfoKey`](/documentation/CreateML/MLProgress/phaseKey)

The key that accesses the current phase value.

[`static let itemCountKey: ProgressUserInfoKey`](/documentation/CreateML/MLProgress/itemCountKey)

The key that accesses the current item count value.

[`static let totalItemCountKey: ProgressUserInfoKey`](/documentation/CreateML/MLProgress/totalItemCountKey)

The key that accesses the total item count value.

### Accessing assessment metrics

[`static let accuracyKey: ProgressUserInfoKey`](/documentation/CreateML/MLProgress/accuracyKey)

The key that accesses the training accuracy value.

[`static let lossKey: ProgressUserInfoKey`](/documentation/CreateML/MLProgress/lossKey)

The key that accesses the training loss value.

[`static let validationAccuracyKey: ProgressUserInfoKey`](/documentation/CreateML/MLProgress/validationAccuracyKey)

The key that accesses the validation accuracy value.

[`static let validationLossKey: ProgressUserInfoKey`](/documentation/CreateML/MLProgress/validationLossKey)

The key that accesses the validation loss value.

### Accessing style transfer metrics

[`static let contentLossKey: ProgressUserInfoKey`](/documentation/CreateML/MLProgress/contentLossKey)

The key that accesses the content image loss value.

[`static let styleLossKey: ProgressUserInfoKey`](/documentation/CreateML/MLProgress/styleLossKey)

The key that accesses the style image loss value.

[`static let stylizedImageKey: ProgressUserInfoKey`](/documentation/CreateML/MLProgress/stylizedImageKey)

The key that accesses the stylized image value.

### Accessing error information

[`static let maximumErrorKey: ProgressUserInfoKey`](/documentation/CreateML/MLProgress/maximumErrorKey)

They key that accesses the maximum error value.

[`static let rootMeanSquaredErrorKey: ProgressUserInfoKey`](/documentation/CreateML/MLProgress/rootMeanSquaredErrorKey)

They key that accesses the root-mean-squared error value.

[`static let validationMaximumErrorKey: ProgressUserInfoKey`](/documentation/CreateML/MLProgress/validationMaximumErrorKey)

They key that accesses the validation maximum error value.

[`static let validationRootMeanSquaredErrorKey: ProgressUserInfoKey`](/documentation/CreateML/MLProgress/validationRootMeanSquaredErrorKey)

They key that accesses the validation root-mean-squared error value.

### Encoding and decoding a session’s progress

[`func encode(to: any Encoder) throws`](/documentation/CreateML/MLProgress/encode(to:))

Encodes the progress value into the given encoder.

[`init(from: any Decoder) throws`](/documentation/CreateML/MLProgress/init(from:))

Creates a progress instance by decoding from the given decoder.

## Relationships

### Conforms To

[`Encodable`](/documentation/Swift/Encodable)

[`Decodable`](/documentation/Swift/Decodable)

---

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)