VGGConfiguration
Options & Configuration · AiDotNet.Configuration
Configuration options for VGG neural network architectures.
For Beginners
VGG networks are deep convolutional neural networks designed for image classification. This configuration lets you choose which VGG variant to use (VGG11, VGG13, VGG16, or VGG19), set the number of output classes for your classification task, and optionally customize the input image dimensions and other parameters.
How It Works
This configuration class provides all the settings needed to instantiate a VGG network. It follows the AiDotNet pattern where users provide minimal configuration and the library supplies sensible defaults.
Typical Usage:
Constructors
| Constructor | Summary |
|---|---|
VGGConfiguration(VGGVariant variant, int numClasses, int inputHeight, int inputWidth, int inputChannels, double dropoutRate, bool includeClassifier) |
Initializes a new instance of the VGGConfiguration class. |
Properties
| Property | Summary |
|---|---|
VGGVariant Variant { get; } |
Gets the VGG variant to use. |
bool IncludeClassifier { get; } |
Gets whether to include the fully connected classifier layers. |
bool UseAutodiff { get; set; } |
Gets or sets whether to use automatic differentiation for backpropagation. |
bool UseBatchNormalization { get; } |
Gets whether to use batch normalization. |
double DropoutRate { get; } |
Gets the dropout rate applied to the fully connected layers. |
int InputChannels { get; } |
Gets the number of input channels. |
int InputHeight { get; } |
Gets the height of input images in pixels. |
int InputWidth { get; } |
Gets the width of input images in pixels. |
int NumClasses { get; } |
Gets the number of output classes for classification. |
int NumConvLayers { get; } |
Gets the number of convolutional layers based on the variant. |
int NumWeightLayers { get; } |
Gets the total number of weight layers (conv + FC). |
int TotalInputSize { get; } |
Gets the total number of input features (channels * height * width). |
int[] InputShape { get; } |
Gets the computed input shape as [channels, height, width]. |
int[][] BlockConfiguration { get; } |
Gets the layer configuration for each VGG block. |
Methods
| Method | Summary |
|---|---|
VGGConfiguration CreateForCIFAR(VGGVariant variant, int numClasses) |
Creates a configuration optimized for CIFAR-10/CIFAR-100 datasets. |
VGGConfiguration CreateVGG16BN(int numClasses) |
Creates a new configuration for VGG16 with batch normalization. |