XCSF
1.4.7
XCSF learning classifier system
|
Callback to save XCSF at some frequency. More...
#include <pybind_callback_checkpoint.h>
Public Member Functions | |
CheckpointCallback (py::str monitor, std::string filename, bool save_best_only, int save_freq, bool verbose) | |
Constructs a new checkpoint callback. More... | |
void | save (struct XCSF *xcsf) |
Saves the state of XCSF. More... | |
bool | run (struct XCSF *xcsf, py::dict metrics) override |
Performs callback operations. More... | |
void | finish (struct XCSF *xcsf) override |
Executes any tasks at the end of fitting. More... | |
Public Member Functions inherited from Callback | |
virtual | ~Callback () |
Private Attributes | |
py::str | monitor |
Name of the metric to monitor. More... | |
std::string | filename |
Name of the file to save XCSF. More... | |
bool | save_best_only |
Whether to only save the best population. More... | |
int | save_freq |
Trial frequency to (possibly) make checkpoints. More... | |
bool | verbose |
Whether to display messages when an action is taken. More... | |
double | best_error = std::numeric_limits<double>::max() |
Best error. More... | |
int | save_trial = 0 |
Trial number the last checkpoint was made. More... | |
Callback to save XCSF at some frequency.
Definition at line 42 of file pybind_callback_checkpoint.h.
|
inline |
Constructs a new checkpoint callback.
[in] | monitor | Name of the metric to monitor: {"train", "val"}. |
[in] | filename | Name of the file to save XCSF. |
[in] | save_best_only | Whether to only save the best population. |
[in] | save_freq | Trial frequency to (possibly) make checkpoints. |
[in] | verbose | Whether to display messages when an action is taken. |
Definition at line 53 of file pybind_callback_checkpoint.h.
|
inlineoverridevirtual |
Executes any tasks at the end of fitting.
[in] | xcsf | The XCSF data structure. |
Implements Callback.
Definition at line 117 of file pybind_callback_checkpoint.h.
References save(), and save_best_only.
|
inlineoverridevirtual |
Performs callback operations.
[in] | xcsf | The XCSF data structure. |
[in] | metrics | Dictionary of performance metrics. |
Implements Callback.
Definition at line 94 of file pybind_callback_checkpoint.h.
References best_error, monitor, save(), save_best_only, save_freq, and save_trial.
|
inline |
Saves the state of XCSF.
[in] | xcsf | The XCSF data structure. |
Definition at line 78 of file pybind_callback_checkpoint.h.
References filename, get_timestamp(), and xcsf_save().
Referenced by finish(), and run().
|
private |
|
private |
Name of the file to save XCSF.
Definition at line 126 of file pybind_callback_checkpoint.h.
Referenced by save().
|
private |
Name of the metric to monitor.
Definition at line 125 of file pybind_callback_checkpoint.h.
Referenced by CheckpointCallback(), and run().
|
private |
Whether to only save the best population.
Definition at line 127 of file pybind_callback_checkpoint.h.
|
private |
Trial frequency to (possibly) make checkpoints.
Definition at line 128 of file pybind_callback_checkpoint.h.
Referenced by CheckpointCallback(), and run().
|
private |
Trial number the last checkpoint was made.
Definition at line 132 of file pybind_callback_checkpoint.h.
Referenced by run().
|
private |
Whether to display messages when an action is taken.
Definition at line 129 of file pybind_callback_checkpoint.h.