![]() |
aGrUM 2.3.2
a C++ library for (probabilistic) graphical models
|
Approximation Scheme. More...
#include <IApproximationSchemeConfiguration.h>
Public Types | |
| enum class | ApproximationSchemeSTATE : char { Undefined , Continue , Epsilon , Rate , Limit , TimeLimit , Stopped } |
| The different state of an approximation scheme. More... | |
Public Member Functions | |
Constructor and destructor | |
| IApproximationSchemeConfiguration () | |
| Class constructors. | |
| virtual | ~IApproximationSchemeConfiguration () |
| Class destructor. | |
Getters and setters | |
| std::string | messageApproximationScheme () const |
| Returns the approximation scheme message. | |
| virtual void | setEpsilon (double eps)=0 |
| Given that we approximate f(t), stopping criterion on |f(t+1)-f(t)|. | |
| virtual double | epsilon () const =0 |
| Returns the value of epsilon. | |
| virtual void | disableEpsilon ()=0 |
| Disable stopping criterion on epsilon. | |
| virtual void | enableEpsilon ()=0 |
| Enable stopping criterion on epsilon. | |
| virtual bool | isEnabledEpsilon () const =0 |
| Returns true if stopping criterion on epsilon is enabled, false otherwise. | |
| virtual void | setMinEpsilonRate (double rate)=0 |
| Given that we approximate f(t), stopping criterion on d/dt(|f(t+1)-f(t)|). | |
| virtual double | minEpsilonRate () const =0 |
| Returns the value of the minimal epsilon rate. | |
| virtual void | disableMinEpsilonRate ()=0 |
| Disable stopping criterion on epsilon rate. | |
| virtual void | enableMinEpsilonRate ()=0 |
| Enable stopping criterion on epsilon rate. | |
| virtual bool | isEnabledMinEpsilonRate () const =0 |
| Returns true if stopping criterion on epsilon rate is enabled, false otherwise. | |
| virtual void | setMaxIter (Size max)=0 |
| Stopping criterion on number of iterations. | |
| virtual Size | maxIter () const =0 |
| Returns the criterion on number of iterations. | |
| virtual void | disableMaxIter ()=0 |
| Disable stopping criterion on max iterations. | |
| virtual void | enableMaxIter ()=0 |
| Enable stopping criterion on max iterations. | |
| virtual bool | isEnabledMaxIter () const =0 |
| Returns true if stopping criterion on max iterations is enabled, false otherwise. | |
| virtual void | setMaxTime (double timeout)=0 |
| Stopping criterion on timeout. | |
| virtual double | maxTime () const =0 |
| Returns the timeout (in seconds). | |
| virtual double | currentTime () const =0 |
| Returns the current running time in second. | |
| virtual void | disableMaxTime ()=0 |
| Disable stopping criterion on timeout. | |
| virtual void | enableMaxTime ()=0 |
| Enable stopping criterion on timeout. | |
| virtual bool | isEnabledMaxTime () const =0 |
| Returns true if stopping criterion on timeout is enabled, false otherwise. | |
| virtual void | setPeriodSize (Size p)=0 |
| How many samples between two stopping is enable. | |
| virtual Size | periodSize () const =0 |
| Returns the period size. | |
| virtual void | setVerbosity (bool v)=0 |
| Set the verbosity on (true) or off (false). | |
| virtual bool | verbosity () const =0 |
| Returns true if verbosity is enabled. | |
| virtual ApproximationSchemeSTATE | stateApproximationScheme () const =0 |
| Returns the approximation scheme state. | |
| virtual Size | nbrIterations () const =0 |
| Returns the number of iterations. | |
| virtual const std::vector< double > & | history () const =0 |
| Returns the scheme history. | |
Public Attributes | |
| Signaler3< Size, double, double > | onProgress |
| Progression, error and time. | |
| Signaler1< const std::string & > | onStop |
| Criteria messageApproximationScheme. | |
Approximation Scheme.
An interface for configuration of approximation scheme.
Definition at line 77 of file IApproximationSchemeConfiguration.h.
|
strong |
The different state of an approximation scheme.
| Enumerator | |
|---|---|
| Undefined | |
| Continue | |
| Epsilon | |
| Rate | |
| Limit | |
| TimeLimit | |
| Stopped | |
Definition at line 86 of file IApproximationSchemeConfiguration.h.
| gum::IApproximationSchemeConfiguration::IApproximationSchemeConfiguration | ( | ) |
Class constructors.
Definition at line 56 of file IApproximationSchemeConfiguration.cpp.
References IApproximationSchemeConfiguration().
Referenced by IApproximationSchemeConfiguration(), gum::learning::IBNLearner::IBNLearner(), and ~IApproximationSchemeConfiguration().
|
virtual |
Class destructor.
Definition at line 60 of file IApproximationSchemeConfiguration.cpp.
References IApproximationSchemeConfiguration().
|
pure virtual |
Returns the current running time in second.
Implemented in gum::ApproximationScheme, and gum::learning::IBNLearner.
|
pure virtual |
Disable stopping criterion on epsilon.
Implemented in gum::ApproximationScheme, and gum::learning::IBNLearner.
|
pure virtual |
Disable stopping criterion on max iterations.
Implemented in gum::ApproximationScheme, and gum::learning::IBNLearner.
|
pure virtual |
Disable stopping criterion on timeout.
Implemented in gum::ApproximationScheme, and gum::learning::IBNLearner.
|
pure virtual |
Disable stopping criterion on epsilon rate.
Implemented in gum::ApproximationScheme, and gum::learning::IBNLearner.
|
pure virtual |
Enable stopping criterion on epsilon.
Implemented in gum::ApproximationScheme, and gum::learning::IBNLearner.
|
pure virtual |
Enable stopping criterion on max iterations.
Implemented in gum::ApproximationScheme, and gum::learning::IBNLearner.
|
pure virtual |
Enable stopping criterion on timeout.
Implemented in gum::ApproximationScheme, and gum::learning::IBNLearner.
|
pure virtual |
Enable stopping criterion on epsilon rate.
Implemented in gum::ApproximationScheme, and gum::learning::IBNLearner.
|
pure virtual |
Returns the value of epsilon.
Implemented in gum::ApproximationScheme, and gum::learning::IBNLearner.
Referenced by messageApproximationScheme().
|
pure virtual |
Returns the scheme history.
| OperationNotAllowed | Raised if the scheme did not performed or if verbosity is set to false. |
Implemented in gum::ApproximationScheme, and gum::learning::IBNLearner.
|
pure virtual |
Returns true if stopping criterion on epsilon is enabled, false otherwise.
Implemented in gum::ApproximationScheme, and gum::learning::IBNLearner.
|
pure virtual |
Returns true if stopping criterion on max iterations is enabled, false otherwise.
Implemented in gum::ApproximationScheme, and gum::learning::IBNLearner.
|
pure virtual |
Returns true if stopping criterion on timeout is enabled, false otherwise.
Implemented in gum::ApproximationScheme, and gum::learning::IBNLearner.
|
pure virtual |
Returns true if stopping criterion on epsilon rate is enabled, false otherwise.
Implemented in gum::ApproximationScheme, and gum::learning::IBNLearner.
|
pure virtual |
Returns the criterion on number of iterations.
Implemented in gum::ApproximationScheme, and gum::learning::IBNLearner.
Referenced by messageApproximationScheme().
|
pure virtual |
Returns the timeout (in seconds).
Implemented in gum::ApproximationScheme, and gum::learning::IBNLearner.
Referenced by messageApproximationScheme().
| INLINE std::string gum::IApproximationSchemeConfiguration::messageApproximationScheme | ( | ) | const |
Returns the approximation scheme message.
Definition at line 59 of file IApproximationSchemeConfiguration_inl.h.
References Continue, Epsilon, epsilon(), Limit, maxIter(), maxTime(), minEpsilonRate(), Rate, stateApproximationScheme(), Stopped, TimeLimit, and Undefined.
Referenced by gum::credal::InferenceEngine< GUM_SCALAR >::getApproximationSchemeMsg(), and gum::credal::MultipleInferenceEngine< GUM_SCALAR, LazyPropagation< GUM_SCALAR > >::stateApproximationScheme().
|
pure virtual |
Returns the value of the minimal epsilon rate.
Implemented in gum::ApproximationScheme, and gum::learning::IBNLearner.
Referenced by messageApproximationScheme().
|
pure virtual |
Returns the number of iterations.
| OperationNotAllowed | Raised if the scheme did not perform. |
Implemented in gum::ApproximationScheme, and gum::learning::IBNLearner.
|
pure virtual |
Returns the period size.
Implemented in gum::ApproximationScheme, and gum::learning::IBNLearner.
|
pure virtual |
Given that we approximate f(t), stopping criterion on |f(t+1)-f(t)|.
If the criterion was disabled it will be enabled.
| eps | The new epsilon value. |
| OutOfBounds | Raised if eps < 0. |
Implemented in gum::ApproximationScheme, gum::learning::EMApproximationScheme, and gum::learning::IBNLearner.
|
pure virtual |
Stopping criterion on number of iterations.
If the criterion was disabled it will be enabled.
| max | The maximum number of iterations. |
| OutOfBounds | Raised if max <= 1. |
Implemented in gum::ApproximationScheme, and gum::learning::IBNLearner.
|
pure virtual |
Stopping criterion on timeout.
If the criterion was disabled it will be enabled.
| timeout | The timeout value in seconds. |
| OutOfBounds | Raised if timeout <= 0.0. |
Implemented in gum::ApproximationScheme, and gum::learning::IBNLearner.
|
pure virtual |
Given that we approximate f(t), stopping criterion on d/dt(|f(t+1)-f(t)|).
If the criterion was disabled it will be enabled
| rate | The minimal epsilon rate. |
| OutOfBounds | if rate<0 |
Implemented in gum::ApproximationScheme, gum::learning::EMApproximationScheme, and gum::learning::IBNLearner.
|
pure virtual |
How many samples between two stopping is enable.
| p | The new period value. |
| OutOfBounds | Raised if p < 1. |
Implemented in gum::ApproximationScheme, and gum::learning::IBNLearner.
|
pure virtual |
Set the verbosity on (true) or off (false).
| v | If true, then verbosity is turned on. |
Implemented in gum::ApproximationScheme, and gum::learning::IBNLearner.
|
pure virtual |
Returns the approximation scheme state.
Implemented in gum::ApproximationScheme, and gum::learning::IBNLearner.
Referenced by messageApproximationScheme().
|
pure virtual |
Returns true if verbosity is enabled.
Implemented in gum::ApproximationScheme, and gum::learning::IBNLearner.
Progression, error and time.
Definition at line 80 of file IApproximationSchemeConfiguration.h.
Referenced by gum::learning::IBNLearner::distributeProgress(), gum::learning::Miic::initiation_(), gum::learning::SimpleMiic::initiation_(), gum::learning::Miic::iteration_(), gum::learning::SimpleMiic::iteration_(), gum::learning::SimpleMiic::orientationLatents_(), gum::learning::Miic::orientationMiic_(), and gum::learning::SimpleMiic::orientationMiic_().
| Signaler1< const std::string& > gum::IApproximationSchemeConfiguration::onStop |
Criteria messageApproximationScheme.
Definition at line 83 of file IApproximationSchemeConfiguration.h.
Referenced by gum::learning::IBNLearner::distributeStop().