---
title: "init(type:reductionType:weight:)"
framework: ML Compute
role: symbol
role_heading: Initializer
platforms: [iOS 14.0+, iPadOS 14.0+, Mac Catalyst 14.0+, macOS 11.0+, tvOS 14.0+]
path: "mlcompute/mlclossdescriptor/init(type:reductiontype:weight:)"
---

# init(type:reductionType:weight:)

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

## Declaration

```swift
convenience init(type lossType: MLCLossType, reductionType: MLCReductionType, weight: Float)
```

## Parameters

- `lossType`: The loss function type.
- `reductionType`: The reduction operation type.
- `weight`: A scalar floating-point weight value.

## See Also

### Creating Loss Descriptors

- [init(type:reductionType:)](mlcompute/mlclossdescriptor/init(type:reductiontype:).md)
- [init(type:reductionType:weight:labelSmoothing:classCount:)](mlcompute/mlclossdescriptor/init(type:reductiontype:weight:labelsmoothing:classcount:).md)
- [init(type:reductionType:weight:labelSmoothing:classCount:epsilon:delta:)](mlcompute/mlclossdescriptor/init(type:reductiontype:weight:labelsmoothing:classcount:epsilon:delta:).md)
