IPaperOptimizerVariant

Interfaces · AiDotNet.Interfaces

Implemented by models whose paper specifies different hyperparameters per size or configuration variant, so the right PaperOptimizerAttribute can be selected.

Known implementations: FishSpeechBase<T>, HuBERT<T>, MusicGenModel<T>, SVTR<T>, Wav2Vec2<T>, WavLM<T>, WhisperModel<T>

For Beginners

Many models come in sizes — tiny, base, large, huge. Papers often train the big ones at a smaller learning rate, because a rate that suits a small model makes a large one diverge. This property tells the library which size this instance is, so it picks the matching row from the paper.

How It Works

A model with a single set of paper hyperparameters does not need this: one unkeyed [PaperOptimizer] applies to every instance. Implement it only where the paper genuinely differs by variant, for example InternImage-T versus InternImage-H.

Returning the variant as a string rather than the enum itself keeps this interface free of a per-model generic parameter, and matches the attribute’s Variant, which is written as nameof(SomeSizeEnum.Huge) so a rename stays a compile error.

Properties

Property Summary
string PaperOptimizerVariant { get; } The variant key for this instance, matching a [PaperOptimizer(Variant = ...)] declaration.