Class MultiModalPolicy<T>
- Namespace
- AiDotNet.ReinforcementLearning.Policies
- Assembly
- AiDotNet.dll
Multi-modal policy using mixture of Gaussians for complex action distributions.
public class MultiModalPolicy<T> : PolicyBase<T>, IPolicy<T>, IDisposable
Type Parameters
T
- Inheritance
-
PolicyBase<T>MultiModalPolicy<T>
- Implements
-
IPolicy<T>
- Inherited Members
Constructors
MultiModalPolicy(NeuralNetwork<T>, int, int, IExplorationStrategy<T>, Random?)
public MultiModalPolicy(NeuralNetwork<T> policyNetwork, int actionSize, int numComponents, IExplorationStrategy<T> explorationStrategy, Random? random = null)
Parameters
policyNetworkNeuralNetwork<T>actionSizeintnumComponentsintexplorationStrategyIExplorationStrategy<T>randomRandom
Methods
ComputeLogProb(Vector<T>, Vector<T>)
Computes the log probability of a given action in a given state. Used by policy gradient methods (PPO, A2C, etc.).
public override T ComputeLogProb(Vector<T> state, Vector<T> action)
Parameters
stateVector<T>The state observation.
actionVector<T>The action taken.
Returns
- T
The log probability of the action.
GetNetworks()
Gets the neural networks used by this policy.
public override IReadOnlyList<INeuralNetwork<T>> GetNetworks()
Returns
- IReadOnlyList<INeuralNetwork<T>>
A read-only list of neural networks.
Reset()
Resets any internal state (e.g., for recurrent policies, exploration noise).
public override void Reset()
SelectAction(Vector<T>, bool)
Selects an action given the current state.
public override Vector<T> SelectAction(Vector<T> state, bool training = true)
Parameters
stateVector<T>The current state observation.
trainingboolWhether the agent is training (enables exploration).
Returns
- Vector<T>
The selected action vector.