<!--
{
  "availability" : [
    "iOS: -",
    "iPadOS: -",
    "macCatalyst: -",
    "macOS: -",
    "tvOS: -",
    "visionOS: -",
    "watchOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "Accelerate",
  "identifier" : "/documentation/Accelerate/BNNSLossReductionFunction",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "Accelerate"
    ],
    "preciseIdentifier" : "c:@EA@BNNSLossReductionFunction"
  },
  "title" : "BNNSLossReductionFunction"
}
-->

# BNNSLossReductionFunction

Constants that describe reduction functions used by a loss layer.

```
struct BNNSLossReductionFunction
```

## Topics

### Raw Values

### Reduction Functions

[`rawValue`](/documentation/Accelerate/BNNSLossReductionFunction/rawValue)

[`init(_:)`](/documentation/Accelerate/BNNSLossReductionFunction/init(_:))

[`init(rawValue:)`](/documentation/Accelerate/BNNSLossReductionFunction/init(rawValue:))

[`BNNSLossReductionMean`](/documentation/Accelerate/BNNSLossReductionMean)

Sums the loss of all samples in the batch and divides by the number of samples.

[`BNNSLossReductionNonZeroWeightMean`](/documentation/Accelerate/BNNSLossReductionNonZeroWeightMean)

Sums the loss of all samples in the batch and divides by the number of non-zero weights.

[`BNNSLossReductionSum`](/documentation/Accelerate/BNNSLossReductionSum)

Sums the loss of all samples in the batch.

[`BNNSLossReductionWeightedMean`](/documentation/Accelerate/BNNSLossReductionWeightedMean)

Sums the loss of all samples in the batch and divides by the sum of all weights.

[`BNNSLossReductionNone`](/documentation/Accelerate/BNNSLossReductionNone)

Returns the loss without any reduction.



---

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)