LazyInitializationStrategy<T>

Models & Types ยท AiDotNet.Initialization

Lazy initialization strategy that defers weight allocation until first Forward() call.

Inheritance: InitializationStrategyBase<T> โ†’ LazyInitializationStrategy<T>

For Beginners

Think of lazy initialization like making dinner reservations versus cooking dinner. The reservation (lazy) is fast - the cooking happens later when you actually need it. This makes creating networks much faster when you just want to inspect them or compare their structures.

How It Works

This strategy significantly speeds up network construction by not allocating or initializing weight tensors until they are actually needed. This is particularly useful for tests and when comparing network architectures without actually running them.

Constructors

Constructor Summary
LazyInitializationStrategy()

Properties

Property Summary
bool IsLazy { get; }
bool LoadFromExternal { get; }

Methods

Method Summary
void InitializeBiases(Tensor<T> biases)
void InitializeWeights(Tensor<T> weights, int inputSize, int outputSize)