AugmentationConfig
Options & Configuration · AiDotNet.Augmentation
Unified configuration for data augmentation with industry-standard defaults.
Known derived types: AugmentationConfig<T, TInput>
For Beginners
Data augmentation creates variations of your training data (like flipping images, adding noise, or shuffling words) to help your model learn better and become more robust. This configuration controls how augmentation works.
How It Works
Key features:
- Automatic data-type detection (image, tabular, audio, text, video)
- Industry-standard defaults that work well out-of-the-box
- Test-Time Augmentation (TTA) enabled by default for better predictions
- Modality-specific settings for fine-tuning
Example - Simple usage with defaults:
Example - Custom configuration:
Constructors
| Constructor | Summary |
|---|---|
AugmentationConfig() |
Creates a new augmentation configuration with industry-standard defaults. |
Properties
| Property | Summary |
|---|---|
AudioAugmentationSettings AudioSettings { get; set; } |
Gets or sets audio-specific augmentation settings. |
ImageAugmentationSettings ImageSettings { get; set; } |
Gets or sets image-specific augmentation settings. |
PredictionAggregationMethod TTAAggregation { get; set; } |
Gets or sets how to aggregate TTA predictions. |
TabularAugmentationSettings TabularSettings { get; set; } |
Gets or sets tabular-specific augmentation settings. |
TextAugmentationSettings TextSettings { get; set; } |
Gets or sets text-specific augmentation settings. |
VideoAugmentationSettings VideoSettings { get; set; } |
Gets or sets video-specific augmentation settings. |
bool EnableTTA { get; set; } |
Gets or sets whether Test-Time Augmentation is enabled during inference. |
bool IsEnabled { get; set; } |
Gets or sets whether augmentation is enabled. |
bool TTAIncludeOriginal { get; set; } |
Gets or sets whether to include the original (non-augmented) sample in TTA. |
double Probability { get; set; } |
Gets or sets the global probability of applying any augmentation. |
int TTANumAugmentations { get; set; } |
Gets or sets the number of augmented samples for TTA. |
int? Seed { get; set; } |
Gets or sets the random seed for reproducible augmentations. |
object CustomAugmenter { get; set; } |
User-supplied custom augmenter object — when set, BuildAsync will invoke its Apply method on each training input before the optimizer runs. |
Methods
| Method | Summary |
|---|---|
AugmentationConfig ForAudio() |
Creates an augmentation configuration for audio data with standard defaults. |
AugmentationConfig ForImages() |
Creates an augmentation configuration for image data with standard defaults. |
AugmentationConfig ForTabular() |
Creates an augmentation configuration for tabular data with standard defaults. |
AugmentationConfig ForText() |
Creates an augmentation configuration for text data with standard defaults. |
AugmentationConfig ForVideo() |
Creates an augmentation configuration for video data with standard defaults. |
IDictionary<string, object> GetConfiguration() |
Gets the configuration as a dictionary for logging or serialization. |
void SetCustomAugmenter(IAugmentation<TNum, TData> augmenter) |
Strongly-typed setter that constrains the augmenter’s type arguments at the call site. |