18#include <learning/policy.h>
48 ANN_Policy (
int n_states,
int n_actions,
int n_hidden = 0,
real alpha=0.1,
real gamma=0.8,
real lambda=0.8,
bool eligibility =
false,
bool softmax =
false,
real randomness=0.1,
real init_eval=0.0,
bool separate_actions =
false);
struct ANN_ ANN
ANN management structure.
real J_ps_pa
Evaluation of last action.
virtual real getLastActionValue()
Return the last action value.
virtual int SelectAction(int s, real r, int forced_a=-1)
Keep the base discrete-state overload visible for callers using DiscretePolicy's interface.
virtual real * getActionProbabilities()
ANN * J
Evaluation network.
virtual void Reset()
Reset eligibility traces.
bool eligibility
eligibility option
ANN_Policy(int n_states, int n_actions, int n_hidden=0, real alpha=0.1, real gamma=0.8, real lambda=0.8, bool eligibility=false, bool softmax=false, real randomness=0.1, real init_eval=0.0, bool separate_actions=false)
Make a new policy.
ANN ** Ja
Evaluation networks (for separate_actions case)
virtual bool useConfidenceEstimates(bool confidence, real zeta, bool confidence_eligibility)
Use confidence estimates with the base class signature.
real * JQs
Placeholder for evaluation vector (separate_actions)
bool separate_actions
Single/separate evaluation option.
real * ps
Previous state vector.
real * delta_vector
Scratch vector for TD error.
int n_states
number of states
DiscretePolicy(int n_states, int n_actions, real alpha=0.1, real gamma=0.8, real lambda=0.8, bool softmax=false, real randomness=0.1, real init_eval=0.0)
Create a new discrete policy.
int n_actions
number of actions
real zeta
Confidence smoothing.
real lambda
Eligibility trace decay.
bool confidence
Confidence estimates option.
real gamma
Future discount parameter.
bool confidence_eligibility
Apply eligibility traces to confidence.
real * eval
evaluation of current aciton