XCSF  1.4.7
XCSF learning classifier system
sam.h File Reference

Self-adaptive mutation functions. More...

#include "xcsf.h"
Include dependency graph for sam.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define SAM_LOG_NORMAL   (0)
 Log normal self-adaptation. More...
 
#define SAM_RATE_SELECT   (1)
 Ten normally distributed rates. More...
 
#define SAM_UNIFORM   (2)
 Uniformly random self-adaptation. More...
 

Functions

void sam_adapt (double *mu, const int N, const int *type)
 Self-adapts mutation rates. More...
 
void sam_init (double *mu, const int N, const int *type)
 Initialises self-adaptive mutation rates. More...
 
void sam_json_import (double *mu, const int N, const cJSON *json)
 Initialises a mutation vector from a cJSON object. More...
 

Detailed Description

Self-adaptive mutation functions.

Author
Richard Preen rpree.nosp@m.n@gm.nosp@m.ail.c.nosp@m.om
Date
2015–2021.

Definition in file sam.h.

Macro Definition Documentation

◆ SAM_LOG_NORMAL

#define SAM_LOG_NORMAL   (0)

Log normal self-adaptation.

Definition at line 28 of file sam.h.

◆ SAM_RATE_SELECT

#define SAM_RATE_SELECT   (1)

Ten normally distributed rates.

Definition at line 29 of file sam.h.

◆ SAM_UNIFORM

#define SAM_UNIFORM   (2)

Uniformly random self-adaptation.

Definition at line 30 of file sam.h.

Function Documentation

◆ sam_adapt()

void sam_adapt ( double *  mu,
const int  N,
const int *  type 
)

Self-adapts mutation rates.

Parameters
[in,out]muVector of mutation rates.
[in]NNumber of mutation rates.
[in]typeVector specifying each rate type.

Definition at line 68 of file sam.c.

References clamp(), mrates, MU_EPSILON, N_RATES, rand_normal(), rand_uniform(), rand_uniform_int(), SAM_LOG_NORMAL, SAM_RATE_SELECT, and SAM_UNIFORM.

Referenced by act_integer_mutate(), cond_ellipsoid_mutate(), cond_rectangle_mutate(), cond_ternary_mutate(), graph_mutate(), neural_layer_connected_mutate(), neural_layer_convolutional_mutate(), neural_layer_lstm_mutate(), neural_layer_recurrent_mutate(), pred_nlms_mutate(), and tree_mutate().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ sam_init()

void sam_init ( double *  mu,
const int  N,
const int *  type 
)

Initialises self-adaptive mutation rates.

Parameters
[out]muVector of mutation rates.
[in]NNumber of mutation rates.
[in]typeVector specifying each rate type.

Definition at line 43 of file sam.c.

References mrates, MU_EPSILON, N_RATES, rand_uniform(), rand_uniform_int(), SAM_LOG_NORMAL, SAM_RATE_SELECT, and SAM_UNIFORM.

Referenced by act_integer_init(), cond_ellipsoid_init(), cond_rectangle_init(), cond_ternary_init(), graph_init(), neural_layer_connected_init(), neural_layer_convolutional_init(), neural_layer_lstm_init(), neural_layer_recurrent_init(), pred_nlms_init(), and tree_rand().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ sam_json_import()

void sam_json_import ( double *  mu,
const int  N,
const cJSON *  json 
)

Initialises a mutation vector from a cJSON object.

Parameters
[in,out]muVector of mutation rates.
[in]NNumber of mutation rates.
[in]jsoncJSON object.

Definition at line 100 of file sam.c.

Referenced by act_integer_json_import(), cond_ellipsoid_json_import(), cond_rectangle_json_import(), cond_ternary_json_import(), graph_json_import(), and pred_nlms_json_import().

Here is the caller graph for this function: