EpsilonGreedyExploration<T>
Models & Types ยท AiDotNet.ReinforcementLearning.Policies.Exploration
Epsilon-greedy exploration: with probability epsilon, select random action.
Inheritance: ExplorationStrategyBase<T> โ EpsilonGreedyExploration<T>
Example
var random = new Random(42);
var state = new Vector<double>(new double[] { 0.1, -0.4, 0.7, 0.2 });
// Create epsilon-greedy exploration with annealing from 1.0 to 0.01
var exploration = new EpsilonGreedyExploration<double>(epsilonStart: 1.0, epsilonEnd: 0.01, epsilonDecay: 0.995);
// With probability epsilon, select a random action instead of the policy action
var policyAction = new Vector<double>(new double[] { 0.0, 1.0, 0.0 });
var action = exploration.GetExplorationAction(state, policyAction, actionSpaceSize: 3, random);
Constructors
| Constructor | Summary |
|---|---|
EpsilonGreedyExploration(double epsilonStart, double epsilonEnd, double epsilonDecay) |
Properties
| Property | Summary |
|---|---|
double CurrentEpsilon { get; } |
Methods
| Method | Summary |
|---|---|
Vector<T> GetExplorationAction(Vector<T> state, Vector<T> policyAction, int actionSpaceSize, Random random) |
|
void Reset() |
|
void Update() |