XCSF
1.4.7
XCSF learning classifier system
|
Functions for setting and printing parameters. More...
Go to the source code of this file.
Macros | |
#define | PARAM_INVALID (-1) |
Code for invalid parameter. More... | |
#define | PARAM_NOT_FOUND (0) |
Code for unable to find parameter. More... | |
#define | PARAM_FOUND (1) |
Code for a found parameter. More... | |
Functions | |
char * | param_json_export (const struct XCSF *xcsf) |
Returns a json formatted string representation of the parameters. More... | |
void | param_json_import (struct XCSF *xcsf, const char *json_str) |
Sets the parameters from a json formatted string. More... | |
void | param_free (struct XCSF *xcsf) |
void | param_print (const struct XCSF *xcsf) |
Prints all XCSF parameters. More... | |
void | param_init (struct XCSF *xcsf, const int x_dim, const int y_dim, const int n_actions) |
Initialises default XCSF parameters. More... | |
size_t | param_load (struct XCSF *xcsf, FILE *fp) |
Reads the XCSF data structure from a file. More... | |
size_t | param_save (const struct XCSF *xcsf, FILE *fp) |
Writes the XCSF data structure to a file. More... | |
const char * | param_set_omp_num_threads (struct XCSF *xcsf, const int a) |
Sets the number of OMP threads. More... | |
const char * | param_set_random_state (struct XCSF *xcsf, const int a) |
const char * | param_set_population_file (struct XCSF *xcsf, const char *a) |
const char * | param_set_pop_init (struct XCSF *xcsf, const bool a) |
const char * | param_set_max_trials (struct XCSF *xcsf, const int a) |
const char * | param_set_perf_trials (struct XCSF *xcsf, const int a) |
const char * | param_set_pop_size (struct XCSF *xcsf, const int a) |
int | param_set_loss_func_string (struct XCSF *xcsf, const char *a) |
void | param_set_loss_func (struct XCSF *xcsf, const int a) |
const char * | param_set_stateful (struct XCSF *xcsf, const bool a) |
const char * | param_set_compaction (struct XCSF *xcsf, const bool a) |
const char * | param_set_huber_delta (struct XCSF *xcsf, const double a) |
const char * | param_set_gamma (struct XCSF *xcsf, const double a) |
const char * | param_set_teletransportation (struct XCSF *xcsf, const int a) |
const char * | param_set_p_explore (struct XCSF *xcsf, const double a) |
const char * | param_set_alpha (struct XCSF *xcsf, const double a) |
const char * | param_set_beta (struct XCSF *xcsf, const double a) |
const char * | param_set_delta (struct XCSF *xcsf, const double a) |
const char * | param_set_e0 (struct XCSF *xcsf, const double a) |
const char * | param_set_init_error (struct XCSF *xcsf, const double a) |
const char * | param_set_init_fitness (struct XCSF *xcsf, const double a) |
const char * | param_set_nu (struct XCSF *xcsf, const double a) |
const char * | param_set_theta_del (struct XCSF *xcsf, const int a) |
const char * | param_set_m_probation (struct XCSF *xcsf, const int a) |
const char * | param_set_set_subsumption (struct XCSF *xcsf, const bool a) |
const char * | param_set_theta_sub (struct XCSF *xcsf, const int a) |
const char * | param_set_x_dim (struct XCSF *xcsf, const int a) |
const char * | param_set_explore (struct XCSF *xcsf, const bool a) |
const char * | param_set_y_dim (struct XCSF *xcsf, const int a) |
const char * | param_set_n_actions (struct XCSF *xcsf, const int a) |
Functions for setting and printing parameters.
Definition in file param.h.
#define PARAM_NOT_FOUND (0) |
void param_free | ( | struct XCSF * | xcsf | ) |
Definition at line 93 of file param.c.
References action_param_free(), cond_param_free(), and pred_param_free().
Referenced by main().
void param_init | ( | struct XCSF * | xcsf, |
const int | x_dim, | ||
const int | y_dim, | ||
const int | n_actions | ||
) |
Initialises default XCSF parameters.
[in] | xcsf | The XCSF data structure. |
[in] | x_dim | The dimensionality of the input variables. |
[in] | y_dim | The dimensionality of the prediction variables. |
[in] | n_actions | The total number of possible actions. |
Definition at line 45 of file param.c.
References action_param_defaults(), cond_param_defaults(), ea_param_defaults(), LOSS_MAE, param_set_alpha(), param_set_beta(), param_set_compaction(), param_set_delta(), param_set_e0(), param_set_gamma(), param_set_huber_delta(), param_set_init_error(), param_set_init_fitness(), param_set_loss_func(), param_set_m_probation(), param_set_max_trials(), param_set_n_actions(), param_set_nu(), param_set_omp_num_threads(), param_set_p_explore(), param_set_perf_trials(), param_set_pop_init(), param_set_pop_size(), param_set_random_state(), param_set_set_subsumption(), param_set_stateful(), param_set_teletransportation(), param_set_theta_del(), param_set_theta_sub(), param_set_x_dim(), param_set_y_dim(), and pred_param_defaults().
Referenced by env_csv_init(), env_maze_init(), env_mux_init(), and XCS::reset().
char* param_json_export | ( | const struct XCSF * | xcsf | ) |
Returns a json formatted string representation of the parameters.
[in] | xcsf | XCSF data structure. |
Definition at line 113 of file param.c.
References action_param_json_export(), cond_param_json_export(), ea_param_json_export(), LOSS_HUBER, loss_type_as_string(), pred_param_json_export(), RULE_TYPE_DGP, RULE_TYPE_NETWORK, RULE_TYPE_NEURAL, VERSION_BUILD, VERSION_MAJOR, and VERSION_MINOR.
Referenced by XCS::internal_params(), param_print(), and XCS::update_params().
void param_json_import | ( | struct XCSF * | xcsf, |
const char * | json_str | ||
) |
Sets the parameters from a json formatted string.
[in,out] | xcsf | The XCSF data structure. |
[in] | json_str | String encoded in json format. |
Definition at line 437 of file param.c.
References ea_param_json_import(), param_json_import_action(), param_json_import_cl_general(), param_json_import_condition(), param_json_import_general(), param_json_import_multi(), param_json_import_prediction(), param_json_import_subsump(), and utils_json_parse_check().
Referenced by config_read(), and XCS::set_params().
size_t param_load | ( | struct XCSF * | xcsf, |
FILE * | fp | ||
) |
Reads the XCSF data structure from a file.
[in] | xcsf | The XCSF data structure. |
[in] | fp | Pointer to the input file. |
Definition at line 548 of file param.c.
References action_param_load(), cond_param_load(), ea_param_load(), loss_set_func(), and pred_param_load().
Referenced by xcsf_load().
void param_print | ( | const struct XCSF * | xcsf | ) |
Prints all XCSF parameters.
[in] | xcsf | The XCSF data structure. |
Definition at line 481 of file param.c.
References param_json_export().
Referenced by main(), and XCS::print_params().
size_t param_save | ( | const struct XCSF * | xcsf, |
FILE * | fp | ||
) |
Writes the XCSF data structure to a file.
[in] | xcsf | The XCSF data structure. |
[in] | fp | Pointer to the output file. |
Definition at line 495 of file param.c.
References action_param_save(), cond_param_save(), ea_param_save(), MAX_LEN, and pred_param_save().
Referenced by xcsf_save().
const char* param_set_alpha | ( | struct XCSF * | xcsf, |
const double | a | ||
) |
Definition at line 764 of file param.c.
Referenced by param_init(), and param_json_import_cl_general().
const char* param_set_beta | ( | struct XCSF * | xcsf, |
const double | a | ||
) |
Definition at line 774 of file param.c.
Referenced by param_init(), and param_json_import_cl_general().
const char* param_set_compaction | ( | struct XCSF * | xcsf, |
const bool | a | ||
) |
Definition at line 717 of file param.c.
Referenced by param_init(), and param_json_import_cl_general().
const char* param_set_delta | ( | struct XCSF * | xcsf, |
const double | a | ||
) |
Definition at line 784 of file param.c.
Referenced by param_init(), and param_json_import_cl_general().
const char* param_set_e0 | ( | struct XCSF * | xcsf, |
const double | a | ||
) |
Definition at line 794 of file param.c.
Referenced by param_init(), and param_json_import_cl_general().
const char* param_set_explore | ( | struct XCSF * | xcsf, |
const bool | a | ||
) |
Definition at line 881 of file param.c.
Referenced by XCS::decision(), xcs_rl_fit(), xcs_rl_trial(), xcs_supervised_fit(), xcs_supervised_predict(), xcs_supervised_score(), and xcs_supervised_score_n().
const char* param_set_gamma | ( | struct XCSF * | xcsf, |
const double | a | ||
) |
Definition at line 734 of file param.c.
Referenced by param_init(), and param_json_import_multi().
const char* param_set_huber_delta | ( | struct XCSF * | xcsf, |
const double | a | ||
) |
Definition at line 724 of file param.c.
Referenced by param_init(), and param_json_import_general().
const char* param_set_init_error | ( | struct XCSF * | xcsf, |
const double | a | ||
) |
Definition at line 804 of file param.c.
Referenced by param_init(), and param_json_import_cl_general().
const char* param_set_init_fitness | ( | struct XCSF * | xcsf, |
const double | a | ||
) |
Definition at line 814 of file param.c.
Referenced by param_init(), and param_json_import_cl_general().
void param_set_loss_func | ( | struct XCSF * | xcsf, |
const int | a | ||
) |
Definition at line 699 of file param.c.
References LOSS_NUM, and loss_set_func().
Referenced by param_init(), and xcsf_ae_to_classifier().
int param_set_loss_func_string | ( | struct XCSF * | xcsf, |
const char * | a | ||
) |
Definition at line 686 of file param.c.
References LOSS_INVALID, loss_set_func(), loss_type_as_int(), PARAM_FOUND, and PARAM_INVALID.
Referenced by param_json_import_general().
const char* param_set_m_probation | ( | struct XCSF * | xcsf, |
const int | a | ||
) |
Definition at line 844 of file param.c.
Referenced by param_init(), and param_json_import_cl_general().
const char* param_set_max_trials | ( | struct XCSF * | xcsf, |
const int | a | ||
) |
Definition at line 656 of file param.c.
Referenced by param_init(), and param_json_import_general().
const char* param_set_n_actions | ( | struct XCSF * | xcsf, |
const int | a | ||
) |
Definition at line 898 of file param.c.
Referenced by param_init(), and param_json_import_general().
const char* param_set_nu | ( | struct XCSF * | xcsf, |
const double | a | ||
) |
Definition at line 824 of file param.c.
Referenced by param_init(), and param_json_import_cl_general().
const char* param_set_omp_num_threads | ( | struct XCSF * | xcsf, |
const int | a | ||
) |
Sets the number of OMP threads.
[in] | xcsf | The XCSF data structure. |
[in] | a | The number of threads. |
Definition at line 614 of file param.c.
Referenced by param_init(), and param_json_import_general().
const char* param_set_p_explore | ( | struct XCSF * | xcsf, |
const double | a | ||
) |
Definition at line 754 of file param.c.
Referenced by param_init(), and param_json_import_multi().
const char* param_set_perf_trials | ( | struct XCSF * | xcsf, |
const int | a | ||
) |
Definition at line 666 of file param.c.
Referenced by param_init(), and param_json_import_general().
const char* param_set_pop_init | ( | struct XCSF * | xcsf, |
const bool | a | ||
) |
Definition at line 649 of file param.c.
Referenced by param_init(), and param_json_import_general().
const char* param_set_pop_size | ( | struct XCSF * | xcsf, |
const int | a | ||
) |
Definition at line 676 of file param.c.
Referenced by param_init(), and param_json_import_general().
const char* param_set_population_file | ( | struct XCSF * | xcsf, |
const char * | a | ||
) |
Definition at line 639 of file param.c.
References MAX_LEN.
Referenced by param_json_import_general().
const char* param_set_random_state | ( | struct XCSF * | xcsf, |
const int | a | ||
) |
Definition at line 627 of file param.c.
References rand_init(), and rand_init_seed().
Referenced by param_init(), and param_json_import_general().
const char* param_set_set_subsumption | ( | struct XCSF * | xcsf, |
const bool | a | ||
) |
Definition at line 854 of file param.c.
Referenced by param_init(), and param_json_import_subsump().
const char* param_set_stateful | ( | struct XCSF * | xcsf, |
const bool | a | ||
) |
Definition at line 710 of file param.c.
Referenced by param_init(), and param_json_import_cl_general().
const char* param_set_teletransportation | ( | struct XCSF * | xcsf, |
const int | a | ||
) |
Definition at line 744 of file param.c.
Referenced by param_init(), and param_json_import_multi().
const char* param_set_theta_del | ( | struct XCSF * | xcsf, |
const int | a | ||
) |
Definition at line 834 of file param.c.
Referenced by param_init(), and param_json_import_cl_general().
const char* param_set_theta_sub | ( | struct XCSF * | xcsf, |
const int | a | ||
) |
Definition at line 861 of file param.c.
Referenced by param_init(), and param_json_import_subsump().
const char* param_set_x_dim | ( | struct XCSF * | xcsf, |
const int | a | ||
) |
Definition at line 871 of file param.c.
Referenced by param_init(), and param_json_import_general().
const char* param_set_y_dim | ( | struct XCSF * | xcsf, |
const int | a | ||
) |
Definition at line 888 of file param.c.
Referenced by param_init(), param_json_import_general(), and xcsf_ae_to_classifier().