Class EfficientNetConfiguration
- Namespace
- AiDotNet.Configuration
- Assembly
- AiDotNet.dll
Configuration options for EfficientNet neural network architectures.
public class EfficientNetConfiguration
- Inheritance
-
EfficientNetConfiguration
- Inherited Members
Remarks
EfficientNet uses compound scaling to balance network depth, width, and resolution. Each variant (B0-B7) represents a different scale factor.
For Beginners: EfficientNet is designed to achieve better accuracy with fewer parameters by systematically scaling all network dimensions. Choose a variant based on your accuracy requirements and computational budget.
Constructors
EfficientNetConfiguration(EfficientNetVariant, int, int, int?, double?, double?)
Initializes a new instance of the EfficientNetConfiguration class.
public EfficientNetConfiguration(EfficientNetVariant variant, int numClasses, int inputChannels = 3, int? customInputHeight = null, double? customWidthMultiplier = null, double? customDepthMultiplier = null)
Parameters
variantEfficientNetVariantThe EfficientNet variant to use.
numClassesintThe number of output classes for classification.
inputChannelsintThe number of input channels (default: 3 for RGB).
customInputHeightint?Custom input height (required when variant is Custom).
customWidthMultiplierdouble?Custom width multiplier (required when variant is Custom).
customDepthMultiplierdouble?Custom depth multiplier (required when variant is Custom).
Properties
CustomDepthMultiplier
Gets the custom depth multiplier (only used when Variant is Custom).
public double? CustomDepthMultiplier { get; }
Property Value
CustomInputHeight
Gets the custom input height (only used when Variant is Custom).
public int? CustomInputHeight { get; }
Property Value
- int?
CustomWidthMultiplier
Gets the custom width multiplier (only used when Variant is Custom).
public double? CustomWidthMultiplier { get; }
Property Value
InputChannels
Gets the number of input channels.
public int InputChannels { get; }
Property Value
InputShape
Gets the computed input shape as [channels, height, width].
public int[] InputShape { get; }
Property Value
- int[]
NumClasses
Gets the number of output classes for classification.
public int NumClasses { get; }
Property Value
Variant
Gets the EfficientNet variant to use.
public EfficientNetVariant Variant { get; }
Property Value
Methods
CreateB0(int)
Creates an EfficientNet-B0 configuration (recommended default).
public static EfficientNetConfiguration CreateB0(int numClasses)
Parameters
numClassesint
Returns
CreateForTesting(int)
Creates a minimal EfficientNet configuration optimized for fast test execution.
public static EfficientNetConfiguration CreateForTesting(int numClasses)
Parameters
numClassesintThe number of output classes.
Returns
- EfficientNetConfiguration
A minimal EfficientNet configuration for testing.
Remarks
Uses 32x32 input resolution with 1.0 width/depth multipliers, resulting in a minimal network suitable for fast unit tests. Construction time is typically under 50ms.
GetDepthMultiplier()
Gets the depth multiplier for this variant.
public double GetDepthMultiplier()
Returns
GetDropoutRate()
Gets the dropout rate for this variant.
public double GetDropoutRate()
Returns
GetInputHeight()
Gets the recommended input height for this variant.
public int GetInputHeight()
Returns
GetInputWidth()
Gets the recommended input width for this variant.
public int GetInputWidth()
Returns
GetWidthMultiplier()
Gets the width multiplier for this variant.
public double GetWidthMultiplier()