Table of Contents

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

variant EfficientNetVariant

The EfficientNet variant to use.

numClasses int

The number of output classes for classification.

inputChannels int

The number of input channels (default: 3 for RGB).

customInputHeight int?

Custom input height (required when variant is Custom).

customWidthMultiplier double?

Custom width multiplier (required when variant is Custom).

customDepthMultiplier double?

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

double?

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

double?

InputChannels

Gets the number of input channels.

public int InputChannels { get; }

Property Value

int

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

int

Variant

Gets the EfficientNet variant to use.

public EfficientNetVariant Variant { get; }

Property Value

EfficientNetVariant

Methods

CreateB0(int)

Creates an EfficientNet-B0 configuration (recommended default).

public static EfficientNetConfiguration CreateB0(int numClasses)

Parameters

numClasses int

Returns

EfficientNetConfiguration

CreateForTesting(int)

Creates a minimal EfficientNet configuration optimized for fast test execution.

public static EfficientNetConfiguration CreateForTesting(int numClasses)

Parameters

numClasses int

The 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

double

GetDropoutRate()

Gets the dropout rate for this variant.

public double GetDropoutRate()

Returns

double

GetInputHeight()

Gets the recommended input height for this variant.

public int GetInputHeight()

Returns

int

GetInputWidth()

Gets the recommended input width for this variant.

public int GetInputWidth()

Returns

int

GetWidthMultiplier()

Gets the width multiplier for this variant.

public double GetWidthMultiplier()

Returns

double