set_hard_label¶
Function¶
A method of the KnowledgeDistillConfig class used to configure the loss weight and loss index of the student model during distillation. This method must be called.
Prototype¶
Parameters¶
| Parameter | Input/Return | Description | Constraints |
|---|---|---|---|
| weight | Input | Weight of the hard loss. | Required. Data type: float. Recommended to be between 0 and 1. |
| index | Input | The output index of the student model. When the student model has multiple outputs, this index determines which output is used to calculate the loss. Only needs to be configured for MindSpore models, typically 0. |
Required. Data type: int. |