XCSF
1.4.7
XCSF learning classifier system
|
System-level functions for initialising, saving, loading, etc. More...
#include "cl.h"
#include "clset.h"
#include "cond_neural.h"
#include "loss.h"
#include "pa.h"
#include "param.h"
#include "pred_neural.h"
Go to the source code of this file.
Functions | |
void | xcsf_init (struct XCSF *xcsf) |
Initialises XCSF with an empty population. More... | |
void | xcsf_free (struct XCSF *xcsf) |
Frees XCSF population sets. More... | |
void | xcsf_print_pset (const struct XCSF *xcsf, const bool print_cond, const bool print_act, const bool print_pred) |
Prints the current XCSF population. More... | |
size_t | xcsf_save (const struct XCSF *xcsf, const char *filename) |
Writes the current state of XCSF to a file. More... | |
size_t | xcsf_load (struct XCSF *xcsf, const char *filename) |
Reads the state of XCSF from a file. More... | |
void | xcsf_pred_expand (const struct XCSF *xcsf) |
Inserts a new hidden layer before the output layer within all prediction neural networks in the population. More... | |
void | xcsf_ae_to_classifier (struct XCSF *xcsf, const int y_dim, const int n_del) |
Switches from autoencoding to classification. More... | |
void | xcsf_store_pset (struct XCSF *xcsf) |
Stores the current population. More... | |
void | xcsf_retrieve_pset (struct XCSF *xcsf) |
Retrieves the previously stored population. More... | |
System-level functions for initialising, saving, loading, etc.
Definition in file xcsf.c.
void xcsf_ae_to_classifier | ( | struct XCSF * | xcsf, |
const int | y_dim, | ||
const int | n_del | ||
) |
Switches from autoencoding to classification.
[in] | xcsf | The XCSF data structure. |
[in] | y_dim | The output dimension (i.e., the number of classes). |
[in] | n_del | The number of hidden layers to remove. |
Definition at line 171 of file xcsf.c.
References Clist::cl, Cl::err, Cl::exp, Cl::fit, LOSS_ONEHOT, Clist::next, pa_free(), pa_init(), param_set_loss_func(), param_set_y_dim(), pred_neural_ae_to_classifier(), Cl::prediction, and Cl::time.
Referenced by XCS::ae_to_classifier().
void xcsf_free | ( | struct XCSF * | xcsf | ) |
Frees XCSF population sets.
[in] | xcsf | The XCSF data structure. |
Definition at line 56 of file xcsf.c.
References clset_kill(), and pa_free().
Referenced by XCS::fit(), and main().
void xcsf_init | ( | struct XCSF * | xcsf | ) |
Initialises XCSF with an empty population.
[in] | xcsf | The XCSF data structure. |
Definition at line 37 of file xcsf.c.
References clset_init(), clset_pset_init(), and pa_init().
Referenced by XCS::fit(), main(), and XCS::XCS().
size_t xcsf_load | ( | struct XCSF * | xcsf, |
const char * | filename | ||
) |
Reads the state of XCSF from a file.
[in] | xcsf | The XCSF data structure. |
[in] | filename | The name of the input file. |
Definition at line 114 of file xcsf.c.
References clset_init(), clset_kill(), clset_pset_load(), param_load(), VERSION_MAJOR, and VERSION_MINOR.
Referenced by XCS::deserialize(), XCS::load(), and main().
void xcsf_pred_expand | ( | const struct XCSF * | xcsf | ) |
Inserts a new hidden layer before the output layer within all prediction neural networks in the population.
[in] | xcsf | The XCSF data structure. |
Definition at line 151 of file xcsf.c.
References Clist::cl, Cl::err, Cl::exp, Cl::fit, Clist::next, pred_neural_expand(), and Cl::time.
Referenced by XCS::pred_expand().
void xcsf_print_pset | ( | const struct XCSF * | xcsf, |
const bool | print_cond, | ||
const bool | print_act, | ||
const bool | print_pred | ||
) |
Prints the current XCSF population.
[in] | xcsf | The XCSF data structure. |
[in] | print_cond | Whether to print condition structures. |
[in] | print_act | Whether to print action structures. |
[in] | print_pred | Whether to print prediction structures. |
Definition at line 77 of file xcsf.c.
References clset_print().
Referenced by XCS::print_pset().
void xcsf_retrieve_pset | ( | struct XCSF * | xcsf | ) |
Retrieves the previously stored population.
[in] | xcsf | The XCSF data structure. |
Definition at line 213 of file xcsf.c.
References clset_init(), and clset_kill().
Referenced by EarlyStoppingCallback::retrieve(), and XCS::retrieve().
size_t xcsf_save | ( | const struct XCSF * | xcsf, |
const char * | filename | ||
) |
Writes the current state of XCSF to a file.
[in] | xcsf | The XCSF data structure. |
[in] | filename | The name of the output file. |
Definition at line 90 of file xcsf.c.
References clset_pset_save(), param_save(), VERSION_BUILD, VERSION_MAJOR, and VERSION_MINOR.
Referenced by XCS::save(), CheckpointCallback::save(), and XCS::serialize().
void xcsf_store_pset | ( | struct XCSF * | xcsf | ) |
Stores the current population.
[in] | xcsf | The XCSF data structure. |
Definition at line 195 of file xcsf.c.
References Clist::cl, cl_init_copy(), clset_add(), clset_kill(), and Clist::next.
Referenced by EarlyStoppingCallback::store(), and XCS::store().