LabelMixingEventArgs<T>
Models & Types · AiDotNet.Augmentation
Event arguments for label mixing operations in augmentations like Mixup and CutMix.
Inheritance: EventArgs → LabelMixingEventArgs<T>
For Beginners
In normal classification, an image is 100% one class (like “cat”). With Mixup/CutMix, we blend two images together, so the label becomes something like “70% cat, 30% dog”. This helps the model learn smoother decision boundaries.
How It Works
When augmentations like Mixup or CutMix are applied, they blend data from two samples together. The labels must also be blended proportionally. This event allows the training loop to handle the soft label generation appropriately.
Constructors
| Constructor | Summary |
|---|---|
LabelMixingEventArgs(Vector<T> originalLabels1, Vector<T> originalLabels2, T mixingLambda, int sampleIndex1, int sampleIndex2, MixingStrategy strategy) |
Creates a new label mixing event. |
Properties
| Property | Summary |
|---|---|
IDictionary<string, object> Metadata { get; } |
Gets additional metadata about the mixing operation. |
MixingStrategy Strategy { get; } |
Gets the mixing strategy used. |
T MixingLambda { get; } |
Gets the mixing coefficient (lambda). |
Vector<T> MixedLabels { get; set; } |
Gets or sets the resulting mixed soft labels. |
Vector<T> OriginalLabels1 { get; } |
Gets the original hard labels for the first sample. |
Vector<T> OriginalLabels2 { get; } |
Gets the original hard labels for the second (mixed) sample. |
int SampleIndex1 { get; } |
Gets the index of the first sample in the batch. |
int SampleIndex2 { get; } |
Gets the index of the second sample in the batch. |