<!--
{
  "availability" : [
    "iOS: 14.0.0 - 18.0.0",
    "iPadOS: 14.0.0 - 18.0.0",
    "macCatalyst: 14.0.0 - 18.0.0",
    "macOS: 11.0.0 - 15.0.0",
    "tvOS: 14.0.0 - 18.0.0",
    "visionOS: 1.0.0 - 2.0.0",
    "watchOS: 7.0.0 - 11.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "Accelerate",
  "identifier" : "/documentation/Accelerate/BNNSLayerParametersLossSigmoidCrossEntropy/init(function:i_desc:o_desc:reduction:label_smooth:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "Accelerate"
    ],
    "preciseIdentifier" : "s:So42BNNSLayerParametersLossSigmoidCrossEntropya8function6i_desc02o_H09reduction12label_smoothABSo16BNNSLossFunctiona_So21BNNSNDArrayDescriptoraAKSo0l9ReductionM0aSftcfc"
  },
  "title" : "init(function:i_desc:o_desc:reduction:label_smooth:)"
}
-->

# init(function:i_desc:o_desc:reduction:label_smooth:)

Returns a new sigmoid cross entropy loss layer parameters structure from the specified parameters.

```
init(function: BNNSLossFunction, i_desc: BNNSNDArrayDescriptor, o_desc: BNNSNDArrayDescriptor, reduction: BNNSLossReductionFunction, label_smooth: Float)
```

## Parameters

`function`

The function that’s used to compute loss.

`i_desc`

The descriptor of the input.

`o_desc`

The descriptor of the output.

`reduction`

The function that’s used to reduce the computed loss.

`label_smooth`

A value that defines the smoothing that the loss function applies to the labels.

## Discussion

> Important:
> The input data type and output data type must be `float`. The output size must be `1`, unless the reduction is ``doc://com.apple.accelerate/documentation/Accelerate/BNNS/LossReduction/none``.

---

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)