![]() |
aGrUM 3.0.0
a C++ library for (probabilistic) graphical models
|
#include <agrum/FMDP/learning/fmdpLearner.h>
Public Member Functions | |
Constructor & destructor. | |
| FMDPLearner (double learningThreshold, bool actionReward, double similarityThreshold=0.05) | |
| Default constructor. | |
| ~FMDPLearner () override | |
| Default destructor. | |
Initialization | |
| void | initialize (FMDP< double > *fmdp) override |
| Initializes the learner. | |
| MultiDimFunctionGraph< double > * | _instantiateFunctionGraph_ () |
| Initializes the learner. | |
| MultiDimFunctionGraph< double > * | _instantiateFunctionGraph_ (Int2Type< IMDDILEARNER >) |
| Initializes the learner. | |
| MultiDimFunctionGraph< double > * | _instantiateFunctionGraph_ (Int2Type< ITILEARNER >) |
| Initializes the learner. | |
| VariableLearnerType * | _instantiateVarLearner_ (MultiDimFunctionGraph< double > *target, gum::VariableSet &mainVariables, const DiscreteVariable *learnedVar) |
| Initializes the learner. | |
| VariableLearnerType * | _instantiateVarLearner_ (MultiDimFunctionGraph< double > *target, gum::VariableSet &mainVariables, const DiscreteVariable *learnedVar, Int2Type< IMDDILEARNER >) |
| Initializes the learner. | |
| VariableLearnerType * | _instantiateVarLearner_ (MultiDimFunctionGraph< double > *target, gum::VariableSet &mainVariables, const DiscreteVariable *learnedVar, Int2Type< ITILEARNER >) |
| Initializes the learner. | |
| RewardLearnerType * | _instantiateRewardLearner_ (MultiDimFunctionGraph< double > *target, gum::VariableSet &mainVariables) |
| Initializes the learner. | |
| RewardLearnerType * | _instantiateRewardLearner_ (MultiDimFunctionGraph< double > *target, gum::VariableSet &mainVariables, Int2Type< IMDDILEARNER >) |
| Initializes the learner. | |
| RewardLearnerType * | _instantiateRewardLearner_ (MultiDimFunctionGraph< double > *target, gum::VariableSet &mainVariables, Int2Type< ITILEARNER >) |
| Initializes the learner. | |
Incremental methods | |
| bool | addObservation (Idx actionId, const Observation *obs) override |
| Gives to the learner a new transition. | |
| void | updateFMDP () override |
| Starts an update of datastructure in the associated FMDP. | |
Private Types | |
| using | VariableLearnerType |
| using | RewardLearnerType |
| using | VarLearnerTable = HashTable< const DiscreteVariable*, VariableLearnerType* > |
Private Attributes | |
| FMDP< double > * | _fmdp_ |
| The FMDP to store the learned model. | |
| HashTable< Idx, VarLearnerTable * > | _actionLearners_ |
| bool | _actionReward_ |
| HashTable< Idx, RewardLearnerType * > | _actionRewardLearners_ |
| RewardLearnerType * | _rewardLearner_ |
| const double | _learningThreshold_ |
| const double | _similarityThreshold_ |
Miscelleanous methods | |
| double | _rmax_ |
| learnerSize | |
| double | _modaMax_ |
| learnerSize | |
| Size | size () override |
| learnerSize | |
| const IVisitableGraphLearner * | varLearner (Idx actionId, const DiscreteVariable *var) const override |
| extractCount | |
| double | rMax () const override |
| learnerSize | |
| double | modaMax () const override |
| learnerSize | |
Definition at line 76 of file fmdpLearner.h.
|
private |
Definition at line 82 of file fmdpLearner.h.
|
private |
Definition at line 77 of file fmdpLearner.h.
|
private |
Definition at line 86 of file fmdpLearner.h.
| gum::FMDPLearner< VariableAttributeSelection, RewardAttributeSelection, LearnerSelection >::FMDPLearner | ( | double | learningThreshold, |
| bool | actionReward, | ||
| double | similarityThreshold = 0.05 ) |
Default constructor.
Definition at line 68 of file fmdpLearner_tpl.h.
References FMDPLearner(), _actionReward_, _learningThreshold_, _rewardLearner_, and _similarityThreshold_.
Referenced by FMDPLearner(), and ~FMDPLearner().
|
override |
Default destructor.
Definition at line 81 of file fmdpLearner_tpl.h.
References FMDPLearner(), _actionLearners_, _actionRewardLearners_, and _rewardLearner_.
| MultiDimFunctionGraph< double > * gum::FMDPLearner< VariableAttributeSelection, RewardAttributeSelection, LearnerSelection >::_instantiateFunctionGraph_ | ( | ) |
Initializes the learner.
Definition at line 237 of file fmdpLearner_tpl.h.
References _instantiateFunctionGraph_().
Referenced by _instantiateFunctionGraph_(), and initialize().
| MultiDimFunctionGraph< double > * gum::FMDPLearner< VariableAttributeSelection, RewardAttributeSelection, LearnerSelection >::_instantiateFunctionGraph_ | ( | Int2Type< IMDDILEARNER > | ) |
Initializes the learner.
Definition at line 245 of file fmdpLearner_tpl.h.
References gum::MultiDimFunctionGraph< GUM_ELEMENT, TerminalNodePolicy >::getReducedAndOrderedInstance().
| MultiDimFunctionGraph< double > * gum::FMDPLearner< VariableAttributeSelection, RewardAttributeSelection, LearnerSelection >::_instantiateFunctionGraph_ | ( | Int2Type< ITILEARNER > | ) |
Initializes the learner.
Definition at line 254 of file fmdpLearner_tpl.h.
References gum::MultiDimFunctionGraph< GUM_ELEMENT, TerminalNodePolicy >::getTreeInstance().
| auto gum::FMDPLearner< VariableAttributeSelection, RewardAttributeSelection, LearnerSelection >::_instantiateRewardLearner_ | ( | MultiDimFunctionGraph< double > * | target, |
| gum::VariableSet & | mainVariables ) |
Initializes the learner.
Definition at line 301 of file fmdpLearner_tpl.h.
References _instantiateRewardLearner_().
Referenced by _instantiateRewardLearner_(), and initialize().
| auto gum::FMDPLearner< VariableAttributeSelection, RewardAttributeSelection, LearnerSelection >::_instantiateRewardLearner_ | ( | MultiDimFunctionGraph< double > * | target, |
| gum::VariableSet & | mainVariables, | ||
| Int2Type< IMDDILEARNER > | ) |
Initializes the learner.
Definition at line 310 of file fmdpLearner_tpl.h.
References _learningThreshold_, and _similarityThreshold_.
| auto gum::FMDPLearner< VariableAttributeSelection, RewardAttributeSelection, LearnerSelection >::_instantiateRewardLearner_ | ( | MultiDimFunctionGraph< double > * | target, |
| gum::VariableSet & | mainVariables, | ||
| Int2Type< ITILEARNER > | ) |
Initializes the learner.
Definition at line 320 of file fmdpLearner_tpl.h.
References _learningThreshold_.
| auto gum::FMDPLearner< VariableAttributeSelection, RewardAttributeSelection, LearnerSelection >::_instantiateVarLearner_ | ( | MultiDimFunctionGraph< double > * | target, |
| gum::VariableSet & | mainVariables, | ||
| const DiscreteVariable * | learnedVar ) |
Initializes the learner.
Definition at line 262 of file fmdpLearner_tpl.h.
References _instantiateVarLearner_().
Referenced by _instantiateVarLearner_(), and initialize().
| auto gum::FMDPLearner< VariableAttributeSelection, RewardAttributeSelection, LearnerSelection >::_instantiateVarLearner_ | ( | MultiDimFunctionGraph< double > * | target, |
| gum::VariableSet & | mainVariables, | ||
| const DiscreteVariable * | learnedVar, | ||
| Int2Type< IMDDILEARNER > | ) |
Initializes the learner.
Definition at line 275 of file fmdpLearner_tpl.h.
References _learningThreshold_, and _similarityThreshold_.
| auto gum::FMDPLearner< VariableAttributeSelection, RewardAttributeSelection, LearnerSelection >::_instantiateVarLearner_ | ( | MultiDimFunctionGraph< double > * | target, |
| gum::VariableSet & | mainVariables, | ||
| const DiscreteVariable * | learnedVar, | ||
| Int2Type< ITILEARNER > | ) |
Initializes the learner.
Definition at line 290 of file fmdpLearner_tpl.h.
References _learningThreshold_.
|
overridevirtual |
Gives to the learner a new transition.
| actionId | : the action on which the transition was made |
| obs | : the observed transition |
Implements gum::ILearningStrategy.
Definition at line 161 of file fmdpLearner_tpl.h.
References _actionLearners_, _actionReward_, _actionRewardLearners_, _fmdp_, _rewardLearner_, _rmax_, and gum::Observation::reward().
|
overridevirtual |
Initializes the learner.
Implements gum::ILearningStrategy.
Definition at line 109 of file fmdpLearner_tpl.h.
References _actionLearners_, _actionReward_, _actionRewardLearners_, _fmdp_, _instantiateFunctionGraph_(), _instantiateRewardLearner_(), _instantiateVarLearner_(), _modaMax_, _rewardLearner_, _rmax_, gum::Set< Key >::insert(), and gum::MultiDimFunctionGraph< GUM_ELEMENT, TerminalNodePolicy >::setTableName().
|
overridevirtual |
learnerSize
Implements gum::ILearningStrategy.
Definition at line 348 of file fmdpLearner_tpl.h.
References _modaMax_.
|
overridevirtual |
learnerSize
Implements gum::ILearningStrategy.
Definition at line 340 of file fmdpLearner_tpl.h.
References _rmax_.
|
overridevirtual |
learnerSize
Implements gum::ILearningStrategy.
Definition at line 189 of file fmdpLearner_tpl.h.
References _actionLearners_, _actionReward_, _actionRewardLearners_, _fmdp_, and _rewardLearner_.
|
overridevirtual |
Starts an update of datastructure in the associated FMDP.
Implements gum::ILearningStrategy.
Definition at line 213 of file fmdpLearner_tpl.h.
References _actionLearners_, _actionReward_, _actionRewardLearners_, _fmdp_, and _rewardLearner_.
|
overridevirtual |
extractCount
Implements gum::ILearningStrategy.
Definition at line 331 of file fmdpLearner_tpl.h.
References _actionLearners_.
|
private |
Definition at line 226 of file fmdpLearner.h.
Referenced by ~FMDPLearner(), addObservation(), initialize(), size(), updateFMDP(), and varLearner().
|
private |
Definition at line 228 of file fmdpLearner.h.
Referenced by FMDPLearner(), addObservation(), initialize(), size(), and updateFMDP().
|
private |
Definition at line 229 of file fmdpLearner.h.
Referenced by ~FMDPLearner(), addObservation(), initialize(), size(), and updateFMDP().
|
private |
The FMDP to store the learned model.
Definition at line 224 of file fmdpLearner.h.
Referenced by addObservation(), initialize(), size(), and updateFMDP().
|
private |
Definition at line 232 of file fmdpLearner.h.
Referenced by FMDPLearner(), _instantiateRewardLearner_(), _instantiateRewardLearner_(), _instantiateVarLearner_(), and _instantiateVarLearner_().
|
private |
learnerSize
Definition at line 217 of file fmdpLearner.h.
Referenced by initialize(), and modaMax().
|
private |
Definition at line 230 of file fmdpLearner.h.
Referenced by FMDPLearner(), ~FMDPLearner(), addObservation(), initialize(), size(), and updateFMDP().
|
private |
learnerSize
Definition at line 211 of file fmdpLearner.h.
Referenced by addObservation(), initialize(), and rMax().
|
private |
Definition at line 233 of file fmdpLearner.h.
Referenced by FMDPLearner(), _instantiateRewardLearner_(), and _instantiateVarLearner_().