ComponentCollectionParameterSource<T>

Models & Types · AiDotNet.Models.Parameters

A COLLECTION of parameterized components exposed as one parameter surface, concatenated in enumeration order.

Implements: IParameterLayoutSource, IParameterSource<T>, IParameterSurfaceLifecycle

How It Works

For a model whose parameters live in a variable set of sub-models rather than in fields: an ensemble, a mixture of experts, a stacked or boosted collection. Every IFullModel is an IParameterSource already, so nothing had to be adapted – what was missing was a way to register the COLLECTION rather than a fixed number of members.

The collection is re-read on every call rather than captured. Registration happens once and lazily, so a source that snapshotted the members would freeze whatever the ensemble held at that instant and then silently disagree with itself the moment a member was added or replaced – which for an ensemble is the normal case, not an edge one.

Constructors

Constructor Summary
ComponentCollectionParameterSource(Func<IEnumerable<IParameterSource<T>>> accessor) Creates a source over whatever components accessor returns.

Properties

Property Summary
long ParameterCount { get; }

Methods

Method Summary
IReadOnlyList<ParameterSlotDescriptor> GetParameterLayout()
Vector<T> GetParameters()
void PrepareParameterSurface(ParameterSurfaceIntent intent)
void SetParameters(Vector<T> parameters)