VariableLengthParameterSource<T>
Models & Types ยท AiDotNet.Models.Parameters
Like DelegatingParameterSource, but sized BY the vector it is restored from.
Implements: IParameterLayoutSource, IVariableLengthParameterSource<T>
How It Works
For a model that packs several pieces into one vector whose width it does not know until it is fitted โ an online learner writes its weights and then a bias, and learns how many weights there are from the first vector it sees. Splitting that into two components would put the variable-length piece FIRST, which the registry cannot slice; owning the whole packing in one component keeps the layout exactly as it was and still leaves one place that decides it.
Constructors
| Constructor | Summary |
|---|---|
VariableLengthParameterSource(Func<long> count, Func<Vector<T>> get, Action<Vector<T>> set) |
Creates a source from count, read and write delegates. |
Properties
| Property | Summary |
|---|---|
bool CanResizeOnRestore { get; } |
|
long ParameterCount { get; } |
Methods
| Method | Summary |
|---|---|
IReadOnlyList<ParameterSlotDescriptor> GetParameterLayout() |
|
Vector<T> GetParameters() |
|
void SetParameters(Vector<T> parameters) |