MultiModalPolicy<T>

Models & Types · AiDotNet.ReinforcementLearning.Policies

Multi-modal policy using mixture of Gaussians for complex action distributions.

Inheritance: ModelBase<T, Vector<T>, Vector<T>> → PolicyBase<T> → MultiModalPolicy<T>

Implements: IGeneratedParameterRegistrar<T>

Example

// Create a multi-modal policy with mixture of Gaussians
var network = new NeuralNetwork<double>();
var policy = new MultiModalPolicy<double>(network, actionSize: 2, numComponents: 3,
    new EpsilonGreedyExploration<double>());
            
// Sample an action from the mixture distribution
var state = new Vector<double>(new double[] { 0.5, -0.3, 1.0, 0.2 });
var action = policy.SelectAction(state, training: true);

Constructors

Constructor Summary
MultiModalPolicy() Initializes a new instance with default settings.
MultiModalPolicy(INeuralNetwork<T> policyNetwork, MultiModalPolicyOptions<T> options) Initializes a new instance of the MultiModalPolicy class from its options: action size, mixture component count, exploration strategy and Seed.
MultiModalPolicy(INeuralNetwork<T> policyNetwork, int actionSize, int numComponents, IExplorationStrategy<T> explorationStrategy, Random random)
MultiModalPolicy(MultiModalPolicyOptions<T> options) Builds the policy from options: a dense ReLU network of the options’ hidden widths from StateSize inputs to a mixing logit, ActionSize means and ActionSize log standard deviations per component (NumComponents × (1 + 2 × ActionSize) output…

Methods

Method Summary
IReadOnlyList<INeuralNetwork<T>> GetNetworks()
T ComputeLogProb(Vector<T> state, Vector<T> action)
Vector<T> SelectAction(Vector<T> state, bool training)
void Reset()