<!--
{
  "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/MLCYOLOLossDescriptor",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "ML Compute"
    ],
    "preciseIdentifier" : "c:objc(cs)MLCYOLOLossDescriptor"
  },
  "title" : "MLCYOLOLossDescriptor"
}
-->

# MLCYOLOLossDescriptor

The configuration object you use to create the YOLO loss layer.

```
class MLCYOLOLossDescriptor
```

## Topics

### Creating YOLO Loss Descriptors

[`init(anchorBoxes:anchorBoxCount:)`](/documentation/MLCompute/MLCYOLOLossDescriptor/init(anchorBoxes:anchorBoxCount:))

Creates a YOLO loss filter descriptor with the anchor box data and number of anchor boxes you specify.

### Inspecting YOLO Loss Descriptors

[`anchorBoxCount`](/documentation/MLCompute/MLCYOLOLossDescriptor/anchorBoxCount)

The number of anchor boxes you use to detect an object in each grid cell.

[`anchorBoxes`](/documentation/MLCompute/MLCYOLOLossDescriptor/anchorBoxes)

Data that contains the width and height for all the anchor boxes.

[`maximumIOUForObjectAbsence`](/documentation/MLCompute/MLCYOLOLossDescriptor/maximumIOUForObjectAbsence)

The negative intersection over union (IOU).

[`minimumIOUForObjectPresence`](/documentation/MLCompute/MLCYOLOLossDescriptor/minimumIOUForObjectPresence)

The positive intersection over union (IOU).

[`scaleClassLoss`](/documentation/MLCompute/MLCYOLOLossDescriptor/scaleClassLoss)

The scale factor you use for loss when there are no object classes, and for loss gradient.

[`scaleObjectConfidenceLoss`](/documentation/MLCompute/MLCYOLOLossDescriptor/scaleObjectConfidenceLoss)

The scale factor you use for object confidence loss and loss gradient.

[`scaleNoObjectConfidenceLoss`](/documentation/MLCompute/MLCYOLOLossDescriptor/scaleNoObjectConfidenceLoss)

The scale factor you use for no object confidence loss and loss gradient.

[`scaleSpatialPositionLoss`](/documentation/MLCompute/MLCYOLOLossDescriptor/scaleSpatialPositionLoss)

The scale factor you use for spatial position loss and loss gradient.

[`scaleSpatialSizeLoss`](/documentation/MLCompute/MLCYOLOLossDescriptor/scaleSpatialSizeLoss)

The scale factor you use for spatial size loss and loss gradient.

[`shouldRescore`](/documentation/MLCompute/MLCYOLOLossDescriptor/shouldRescore)

A Boolean that indicates whether the layer scales the object confidence loss by the intersection over union (IOU) overlap.



---

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)