PolicyBase<T>

Base Classes ยท AiDotNet.ReinforcementLearning.Policies

Abstract base class for policy implementations. Provides common functionality for numeric operations, random number generation, and resource management.

Inheritance: ModelBase<T, Vector<T>, Vector<T>> โ†’ PolicyBase<T>

Implements: IPolicy<T>

Known derived types: BetaPolicy<T>, ContinuousPolicy<T>, DeterministicPolicy<T>, DiscretePolicy<T>, MixedPolicy<T>, MultiModalPolicy<T>

Properties

Property Summary
ILossFunction<T> DefaultLossFunction { get; }

Methods

Method Summary
IFullModel<T, Vector<T>, Vector<T>> DeepCopy()
IFullModel<T, Vector<T>, Vector<T>> WithParameters(Vector<T> parameters)
IReadOnlyList<INeuralNetwork<T>> GetNetworks() Gets the neural networks used by this policy.
T ComputeLogProb(Vector<T> state, Vector<T> action) Computes the log probability of a given action in a given state.
Vector<T> Predict(Vector<T> input) Predicts an action for the given state (inference mode).
Vector<T> SelectAction(Vector<T> state, bool training) Selects an action given the current state.
void Reset() Resets any internal state (e.g., for recurrent policies, exploration noise).
void Train(Vector<T> input, Vector<T> expectedOutput) Training is handled by RL algorithms, not directly on the policy.