Commit 8beeed2
committed
fix: add validation for LabelSmoothingFactor to ensure it's within [0, 1]
Added guard in KnowledgeDistillationOptions.Validate() to ensure
LabelSmoothingFactor is within the valid range of [0, 1].
This prevents invalid configurations where LabelSmoothingFactor could be:
- Negative (which would produce invalid smoothed labels)
- Greater than 1 (which would produce invalid probability distributions)
The check is placed alongside other weight/bound validations (Alpha,
FeatureWeight, AttentionWeight, EMADecay) for consistency.
Throws ArgumentException with clear message and nameof(LabelSmoothingFactor)
for proper error reporting.1 parent bb72f8b commit 8beeed2
1 file changed
+2
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
393 | 393 | | |
394 | 394 | | |
395 | 395 | | |
| 396 | + | |
| 397 | + | |
396 | 398 | | |
397 | 399 | | |
398 | 400 | | |
| |||
0 commit comments