<!--
{
  "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/MLCLossLayer/huberLoss(reductionType:delta:weights:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "ML Compute"
    ],
    "preciseIdentifier" : "c:objc(cs)MLCLossLayer(cm)huberLossWithReductionType:delta:weights:"
  },
  "title" : "huberLoss(reductionType:delta:weights:)"
}
-->

# huberLoss(reductionType:delta:weights:)

Creates a huber loss layer with the reduction type, delta, and weights you specify.

```
class func huberLoss(reductionType: MLCReductionType, delta: Float, weights: MLCTensor?) -> Self
```

## Parameters

`reductionType`

The reduction operation type.

`delta`

The delta value.

`weights`

The loss label weights tensor.

## Return Value

A huber loss layer.

## Discussion

---

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)