<!--
{
  "availability" : [
    "iOS: 14.0.0 - 17.4.0",
    "iPadOS: 14.0.0 - 17.4.0",
    "macCatalyst: 14.0.0 - 17.4.0",
    "macOS: 11.0.0 - 14.3.0",
    "tvOS: 14.0.0 - 17.4.0"
  ],
  "documentType" : "symbol",
  "framework" : "MLCompute",
  "identifier" : "/documentation/MLCompute/MLCLossDescriptor",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "ML Compute"
    ],
    "preciseIdentifier" : "c:objc(cs)MLCLossDescriptor"
  },
  "title" : "MLCLossDescriptor"
}
-->

# MLCLossDescriptor

A configuration object you use to create a loss layer.

```
class MLCLossDescriptor
```

## Topics

### Creating Loss Descriptors

[`init(type:reductionType:)`](/documentation/MLCompute/MLCLossDescriptor/init(type:reductionType:))

Creates a loss descriptor with the loss function and reduction type you specify.

[`init(type:reductionType:weight:)`](/documentation/MLCompute/MLCLossDescriptor/init(type:reductionType:weight:))

Creates a loss descriptor with the loss function, reduction type, and weight you specify.

[`init(type:reductionType:weight:labelSmoothing:classCount:)`](/documentation/MLCompute/MLCLossDescriptor/init(type:reductionType:weight:labelSmoothing:classCount:))

Creates a loss descriptor with the loss function, reduction type, weight, label smoothing, and number of classes you specify.

[`init(type:reductionType:weight:labelSmoothing:classCount:epsilon:delta:)`](/documentation/MLCompute/MLCLossDescriptor/init(type:reductionType:weight:labelSmoothing:classCount:epsilon:delta:))

Creates a loss descriptor with the loss function, reduction type, weight, label smoothing, and number of classes, epsilon, and delta that you specify.

### Inspecting Loss Descriptors

[`lossType`](/documentation/MLCompute/MLCLossDescriptor/lossType)

The loss function type.

[`reductionType`](/documentation/MLCompute/MLCLossDescriptor/reductionType)

The reduction operation performed by the loss function.

[`weight`](/documentation/MLCompute/MLCLossDescriptor/weight)

The scale factor you apply to each element of a result.

[`labelSmoothing`](/documentation/MLCompute/MLCLossDescriptor/labelSmoothing)

The value for label smoothing.

[`classCount`](/documentation/MLCompute/MLCLossDescriptor/classCount)

The number of classes.

[`epsilon`](/documentation/MLCompute/MLCLossDescriptor/epsilon)

The epsilon value.

[`delta`](/documentation/MLCompute/MLCLossDescriptor/delta)

The delta value.



---

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)