XCSF
1.4.7
XCSF learning classifier system
|
Functions operating on neural network arguments/constants. More...
#include "utils.h"
Go to the source code of this file.
Data Structures | |
struct | ArgsLayer |
Parameters for initialising a neural network layer. More... | |
Functions | |
void | layer_args_init (struct ArgsLayer *args) |
Sets layer parameters to default values. More... | |
struct ArgsLayer * | layer_args_copy (const struct ArgsLayer *src) |
Creates and returns a copy of specified layer parameters. More... | |
struct ArgsLayer * | layer_args_tail (struct ArgsLayer *head) |
Returns the current output layer arguments. More... | |
char * | layer_args_json_import (struct ArgsLayer *largs, cJSON *json) |
Sets the layer parameters from a cJSON object. More... | |
char * | layer_args_json_export (struct ArgsLayer *args) |
Returns a json formatted string of the neural layer parameters. More... | |
void | layer_args_free (struct ArgsLayer **largs) |
Frees memory used by a list of layer parameters and points to NULL. More... | |
void | layer_args_validate (struct ArgsLayer *args) |
Checks network layer arguments are valid. More... | |
uint32_t | layer_args_opt (const struct ArgsLayer *args) |
Returns a bitstring representing the permissions granted by a layer. More... | |
size_t | layer_args_save (const struct ArgsLayer *args, FILE *fp) |
Saves neural network layer parameters. More... | |
size_t | layer_args_load (struct ArgsLayer **largs, FILE *fp) |
Loads neural network layer parameters. More... | |
Functions operating on neural network arguments/constants.
Definition in file neural_layer_args.h.
Creates and returns a copy of specified layer parameters.
[in] | src | The layer parameters to be copied. |
Definition at line 77 of file neural_layer_args.c.
References ArgsLayer::channels, ArgsLayer::decay, ArgsLayer::eta, ArgsLayer::eta_min, ArgsLayer::evolve_connect, ArgsLayer::evolve_eta, ArgsLayer::evolve_functions, ArgsLayer::evolve_neurons, ArgsLayer::evolve_weights, ArgsLayer::function, ArgsLayer::height, ArgsLayer::max_neuron_grow, ArgsLayer::momentum, ArgsLayer::n_init, ArgsLayer::n_inputs, ArgsLayer::n_max, ArgsLayer::pad, ArgsLayer::probability, ArgsLayer::recurrent_function, ArgsLayer::scale, ArgsLayer::sgd_weights, ArgsLayer::size, ArgsLayer::stride, ArgsLayer::type, and ArgsLayer::width.
Referenced by act_neural_param_defaults(), cond_neural_param_defaults(), neural_layer_lstm_init(), neural_layer_recurrent_init(), and pred_neural_param_defaults().
void layer_args_free | ( | struct ArgsLayer ** | largs | ) |
Frees memory used by a list of layer parameters and points to NULL.
[in] | largs | Pointer to the list of layer parameters to free. |
Definition at line 451 of file neural_layer_args.c.
References ArgsLayer::next.
Referenced by act_neural_param_json_import(), action_param_free(), cond_neural_param_json_import(), cond_param_free(), layer_args_load(), pred_neural_param_json_import(), and pred_param_free().
void layer_args_init | ( | struct ArgsLayer * | args | ) |
Sets layer parameters to default values.
[in] | args | The layer parameters to initialise. |
Definition at line 42 of file neural_layer_args.c.
References ArgsLayer::channels, CONNECTED, ArgsLayer::decay, ArgsLayer::eta, ArgsLayer::eta_min, ArgsLayer::evolve_connect, ArgsLayer::evolve_eta, ArgsLayer::evolve_functions, ArgsLayer::evolve_neurons, ArgsLayer::evolve_weights, ArgsLayer::function, ArgsLayer::height, LOGISTIC, ArgsLayer::max_neuron_grow, ArgsLayer::momentum, ArgsLayer::n_init, ArgsLayer::n_inputs, ArgsLayer::n_max, ArgsLayer::next, ArgsLayer::pad, ArgsLayer::probability, ArgsLayer::recurrent_function, ArgsLayer::scale, ArgsLayer::sgd_weights, ArgsLayer::size, ArgsLayer::stride, ArgsLayer::type, and ArgsLayer::width.
Referenced by act_neural_param_defaults(), act_neural_param_json_import(), cond_neural_param_defaults(), cond_neural_param_json_import(), layer_args_load(), pred_neural_ae_to_classifier(), pred_neural_expand(), pred_neural_param_defaults(), and pred_neural_param_json_import().
char* layer_args_json_export | ( | struct ArgsLayer * | args | ) |
Returns a json formatted string of the neural layer parameters.
[in] | args | The layer parameters to print. |
Definition at line 377 of file neural_layer_args.c.
References layer_args_json_export_activation(), layer_args_json_export_evo(), layer_args_json_export_inputs(), layer_args_json_export_scale(), layer_args_json_export_sgd(), layer_type_as_string(), neural_create(), neural_free(), neural_init(), and ArgsLayer::next.
Referenced by action_param_json_export(), cond_param_json_export(), and pred_param_json_export().
char* layer_args_json_import | ( | struct ArgsLayer * | args, |
cJSON * | json | ||
) |
Sets the layer parameters from a cJSON object.
[in,out] | args | Layer parameters data structure. |
[in] | json | cJSON object. |
Definition at line 415 of file neural_layer_args.c.
References layer_args_json_import_activation(), layer_args_json_import_evo(), layer_args_json_import_inputs(), layer_args_json_import_scale(), layer_args_json_import_sgd(), layer_type_as_int(), ArgsLayer::n_init, and ArgsLayer::type.
Referenced by act_neural_param_json_import(), cond_neural_param_json_import(), and pred_neural_param_json_import().
size_t layer_args_load | ( | struct ArgsLayer ** | largs, |
FILE * | fp | ||
) |
Loads neural network layer parameters.
[in] | largs | Pointer to the list of layer parameters to load. |
[in] | fp | Pointer to the output file. |
Definition at line 633 of file neural_layer_args.c.
References ArgsLayer::channels, ArgsLayer::decay, ArgsLayer::eta, ArgsLayer::eta_min, ArgsLayer::evolve_connect, ArgsLayer::evolve_eta, ArgsLayer::evolve_functions, ArgsLayer::evolve_neurons, ArgsLayer::evolve_weights, ArgsLayer::function, ArgsLayer::height, layer_args_free(), layer_args_init(), ArgsLayer::max_neuron_grow, ArgsLayer::momentum, ArgsLayer::n_init, ArgsLayer::n_inputs, ArgsLayer::n_max, ArgsLayer::next, ArgsLayer::pad, ArgsLayer::probability, ArgsLayer::recurrent_function, ArgsLayer::scale, ArgsLayer::sgd_weights, ArgsLayer::size, ArgsLayer::stride, ArgsLayer::type, and ArgsLayer::width.
Referenced by action_param_load(), cond_param_load(), and pred_param_load().
uint32_t layer_args_opt | ( | const struct ArgsLayer * | args | ) |
Returns a bitstring representing the permissions granted by a layer.
[in] | args | Layer initialisation parameters. |
Definition at line 541 of file neural_layer_args.c.
References ArgsLayer::evolve_connect, ArgsLayer::evolve_eta, ArgsLayer::evolve_functions, ArgsLayer::evolve_neurons, ArgsLayer::evolve_weights, LAYER_EVOLVE_CONNECT, LAYER_EVOLVE_ETA, LAYER_EVOLVE_FUNCTIONS, LAYER_EVOLVE_NEURONS, LAYER_EVOLVE_WEIGHTS, LAYER_SGD_WEIGHTS, and ArgsLayer::sgd_weights.
Referenced by neural_layer_connected_init(), neural_layer_convolutional_init(), neural_layer_lstm_init(), and neural_layer_recurrent_init().
size_t layer_args_save | ( | const struct ArgsLayer * | args, |
FILE * | fp | ||
) |
Saves neural network layer parameters.
[in] | args | Layer initialisation parameters. |
[in] | fp | Pointer to the output file. |
Definition at line 589 of file neural_layer_args.c.
References ArgsLayer::channels, ArgsLayer::decay, ArgsLayer::eta, ArgsLayer::eta_min, ArgsLayer::evolve_connect, ArgsLayer::evolve_eta, ArgsLayer::evolve_functions, ArgsLayer::evolve_neurons, ArgsLayer::evolve_weights, ArgsLayer::function, ArgsLayer::height, layer_args_length(), ArgsLayer::max_neuron_grow, ArgsLayer::momentum, ArgsLayer::n_init, ArgsLayer::n_inputs, ArgsLayer::n_max, ArgsLayer::next, ArgsLayer::pad, ArgsLayer::probability, ArgsLayer::recurrent_function, ArgsLayer::scale, ArgsLayer::sgd_weights, ArgsLayer::size, ArgsLayer::stride, ArgsLayer::type, and ArgsLayer::width.
Referenced by action_param_save(), cond_param_save(), and pred_param_save().
Returns the current output layer arguments.
[in] | head | Head of the list of layer parameters. |
Definition at line 526 of file neural_layer_args.c.
References ArgsLayer::next.
void layer_args_validate | ( | struct ArgsLayer * | args | ) |
Checks network layer arguments are valid.
[in] | args | List of layer parameters to check. |
Definition at line 500 of file neural_layer_args.c.
References ArgsLayer::evolve_neurons, layer_args_validate_inputs(), ArgsLayer::max_neuron_grow, ArgsLayer::n_init, ArgsLayer::n_max, and ArgsLayer::next.
Referenced by act_neural_param_json_import(), cond_neural_param_json_import(), and pred_neural_param_json_import().