DeepReinforcementLearningAgentBase<T>

Base Classes · AiDotNet.ReinforcementLearning.Agents

Base class for deep reinforcement learning agents that use neural networks as function approximators.

Inheritance: ReinforcementLearningAgentBase<T> → DeepReinforcementLearningAgentBase<T>

Known derived types: A2CAgent<T>, A3CAgent<T>, CQLAgent<T>, DDPGAgent<T>, DQNAgent<T>, DecisionTransformerAgent<T>, DoubleDQNAgent<T>, DreamerAgent<T>, DuelingDQNAgent<T>, IQLAgent<T>, MADDPGAgent<T>, MuZeroAgent<T>, PPOAgent<T>, QMIXAgent<T>, REINFORCEAgent<T>, RainbowDQNAgent<T>, SACAgent<T>, TD3Agent<T>, TRPOAgent<T>, WorldModelsAgent<T>

For Beginners

This is the base class for modern “deep” RL agents.

Deep RL uses neural networks to approximate the policy and/or value functions, enabling agents to handle high-dimensional state spaces (like images) and complex decision problems.

Classical RL methods (tabular Q-learning, linear approximation) inherit directly from ReinforcementLearningAgentBase, while deep RL methods (DQN, PPO, A3C, etc.) inherit from this class which adds neural network support.

Examples of deep RL algorithms:

  • DQN family (DQN, Double DQN, Rainbow)
  • Policy gradient methods (PPO, TRPO, A3C)
  • Actor-Critic methods (SAC, TD3, DDPG)
  • Model-based methods (Dreamer, MuZero, World Models)
  • Transformer-based methods (Decision Transformer)

How It Works

This class extends ReinforcementLearningAgentBase to provide specific support for neural network-based RL algorithms. It manages neural network instances and provides infrastructure for deep RL methods.

Auto-Compile: Policy inference goes through the standard neural-network path, which is auto-compiled by Tensors’ AutoTracer once the input-shape pattern repeats. No explicit compile call is required. Users can opt out via TensorCodecOptions.Current.EnableCompilation = false.

Methods

Method Summary
void ApplyGradients(Vector<T> gradients, T learningRate) Applies pre-computed parameter-space gradients as a single gradient-descent step.
void Dispose() Disposes of resources used by the agent, including every network registered in Networks.