TabularActorCriticAgent<T>

Models & Types ยท AiDotNet.ReinforcementLearning.Agents.AdvancedRL

Tabular Actor-Critic agent combining policy and value learning.

Inheritance: ReinforcementLearningAgentBase<T> โ†’ TabularActorCriticAgent<T>

For Beginners

Actor-Critic has two components working together: the Actor (decides which action to take) and the Critic (evaluates how good the action was). The Critic provides feedback to help the Actor improve, like a coach watching a player. This tabular version stores both policy preferences and value estimates in tables. It combines the benefits of policy-based methods (can learn stochastic policies) with value-based methods (lower variance updates).

Example

// Create a tabular Actor-Critic agent with separate policy and value tables
var options = new TabularActorCriticOptions<double> { StateSize = 4, ActionSize = 2, ActorLearningRate = 0.01 };
var agent = new TabularActorCriticAgent<double>(options);
            
// Select an action using the softmax actor policy
var state = new Vector<double>(new double[] { 0.5, -0.3, 1.0, 0.2 });
var action = agent.SelectAction(state);

Constructors

Constructor Summary
TabularActorCriticAgent() Initializes a new instance with default settings.
TabularActorCriticAgent(TabularActorCriticOptions<T> options)

Properties

Property Summary
int FeatureCount { get; }

Methods

Method Summary
Dictionary<string, T> GetMetrics()
ModelMetadata<T> GetModelMetadata()
T Train()
Task TrainAsync()
Task<Vector<T>> PredictAsync(Vector<T> input)
Vector<T> Predict(Vector<T> input)
Vector<T> SelectAction(Vector<T> state, bool training)
byte[] Serialize() Auto-generated common model serialization surface.
void Deserialize(byte[] data) Auto-generated common model deserialization surface.
void LoadModel(string filepath)
void ResetEpisode()
void SaveModel(string filepath)
void StoreExperience(Vector<T> state, Vector<T> action, T reward, Vector<T> nextState, bool done)