QTableEntriesParameterSource<T>

Models & Types · AiDotNet.ReinforcementLearning.Parameters

Exposes a Q-table as the entries it ACTUALLY holds, rather than padding each state out to the full action count.

Implements: IParameterSource<T>, IParameterTopologySource

How It Works

This is a genuinely different contract from QTableParameterSource and the two must not be swapped. Six agents pad every state to ActionSize and clamp the table to one row; another six walk only the action entries that exist. For a sparsely-visited table those give different lengths, so using the wrong one would resize the model.

padEmptyToOne reproduces the one variation among these agents: some append a single zero when the table is empty so the surface is never zero-length.

Constructors

Constructor Summary
QTableEntriesParameterSource(Dictionary<string, Dictionary<int, T>> table, bool padEmptyToOne, bool sortStateKeys, bool ascendingActions) Wraps table, counting only the entries present.

Properties

Property Summary
long ParameterCount { get; }

Methods

Method Summary
Vector<T> GetParameters()
void ReadParameterTopology(BinaryReader reader)
void SetParameters(Vector<T> parameters)
void WriteParameterTopology(BinaryWriter writer)