ScalarParameterSource<T>
Models & Types · AiDotNet.Models.Parameters
A single scalar exposed as a one-element parameter surface, optionally gated so it contributes nothing until the model is fitted.
Implements: IParameterSource<T>
How It Works
Reads and writes go through delegates rather than a captured value, because the scalar lives in a field the model keeps mutating; capturing it once would freeze the surface at whatever the value was when the component was registered.
The gate exists for detectors whose threshold is only meaningful after fitting. It applies to the COUNT as well as the vector, so the two never disagree: an unfitted model reports zero from both.
Constructors
| Constructor | Summary |
|---|---|
ScalarParameterSource(Func<T> get, Action<T> set, Func<bool> isPresent) |
Creates a source over one scalar. |
Properties
| Property | Summary |
|---|---|
long ParameterCount { get; } |
Methods
| Method | Summary |
|---|---|
Vector<T> GetParameters() |
|
void SetParameters(Vector<T> parameters) |