TokenMix<T>

Models & Types · AiDotNet.Augmentation.Image

TokenMix - token-level mixing for transformer architectures. Randomly selects and replaces individual patches (tokens).

Inheritance: AugmentationBase<T, ImageTensor<T>> → LabelMixingAugmentationBase<T, ImageTensor<T>> → ImageMixingAugmenterBase<T> → TokenMix<T>

Constructors

Constructor Summary
TokenMix(int patchSize, double minMixRatio, double maxMixRatio, double probability)

Properties

Property Summary
double MaxMixRatio { get; }
double MinMixRatio { get; }
int PatchSize { get; }

Methods

Method Summary
IDictionary<string, object> GetParameters()
ImageTensor<T> ApplyTokenMix(ImageTensor<T> image1, ImageTensor<T> image2, Vector<T> labels1, Vector<T> labels2, AugmentationContext<T> context) Mixes two images at the token (patch) level.