SerializedObjectParameterSource<T>

Models & Types · AiDotNet.Models.Parameters

Exposes an explicitly classified fitted object graph through the canonical numeric parameter manifest without requiring its model to hand-write count, flatten and restore methods.

Implements: IParameterLayoutSource, IVariableLengthParameterSource<T>

How It Works

Tree ensembles and other non-gradient models learn topology as well as numeric leaves. Treating only tensors as persistent parameters silently loses the actual model, while guessing that every object is persistent would capture caches and services. This adapter is therefore generator-only and opt-in through [FittedParameter].

Compact UTF-8 JSON bytes are represented as exact numeric values in the flat vector. Every byte is exactly representable by the framework’s supported floating-point types, restore validates the integral byte domain before deserializing, and the learned-state role keeps this surface out of optimizer initialization. A null value remains fit-deferred; a fresh model can accept one variable-width restore, after which its materialized width becomes an exact contract.

Constructors

Constructor Summary
SerializedObjectParameterSource(Func<object> get, Action<object> set, Type stateType) Creates a source over one assignable fitted-state member.

Properties

Property Summary
bool CanResizeOnRestore { get; }
long ParameterCount { get; }

Methods

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