XCSF  1.4.7
XCSF learning classifier system
rule_neural.h File Reference

Neural network rule (condition + action) functions. More...

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

Go to the source code of this file.

Data Structures

struct  RuleNeural
 Neural network rule data structure. More...
 

Functions

bool rule_neural_cond_crossover (const struct XCSF *xcsf, const struct Cl *c1, const struct Cl *c2)
 
bool rule_neural_cond_general (const struct XCSF *xcsf, const struct Cl *c1, const struct Cl *c2)
 
bool rule_neural_cond_match (const struct XCSF *xcsf, const struct Cl *c, const double *x)
 
bool rule_neural_cond_mutate (const struct XCSF *xcsf, const struct Cl *c)
 
void rule_neural_cond_copy (const struct XCSF *xcsf, struct Cl *dest, const struct Cl *src)
 
void rule_neural_cond_cover (const struct XCSF *xcsf, const struct Cl *c, const double *x)
 
void rule_neural_cond_free (const struct XCSF *xcsf, const struct Cl *c)
 
void rule_neural_cond_init (const struct XCSF *xcsf, struct Cl *c)
 
void rule_neural_cond_print (const struct XCSF *xcsf, const struct Cl *c)
 
void rule_neural_cond_update (const struct XCSF *xcsf, const struct Cl *c, const double *x, const double *y)
 
double rule_neural_cond_size (const struct XCSF *xcsf, const struct Cl *c)
 
size_t rule_neural_cond_save (const struct XCSF *xcsf, const struct Cl *c, FILE *fp)
 
size_t rule_neural_cond_load (const struct XCSF *xcsf, struct Cl *c, FILE *fp)
 
char * rule_neural_cond_json_export (const struct XCSF *xcsf, const struct Cl *c)
 
void rule_neural_cond_json_import (const struct XCSF *xcsf, struct Cl *c, const cJSON *json)
 
bool rule_neural_act_crossover (const struct XCSF *xcsf, const struct Cl *c1, const struct Cl *c2)
 
bool rule_neural_act_general (const struct XCSF *xcsf, const struct Cl *c1, const struct Cl *c2)
 
bool rule_neural_act_mutate (const struct XCSF *xcsf, const struct Cl *c)
 
int rule_neural_act_compute (const struct XCSF *xcsf, const struct Cl *c, const double *x)
 
void rule_neural_act_copy (const struct XCSF *xcsf, struct Cl *dest, const struct Cl *src)
 
void rule_neural_act_cover (const struct XCSF *xcsf, const struct Cl *c, const double *x, const int action)
 
void rule_neural_act_free (const struct XCSF *xcsf, const struct Cl *c)
 
void rule_neural_act_init (const struct XCSF *xcsf, struct Cl *c)
 
void rule_neural_act_print (const struct XCSF *xcsf, const struct Cl *c)
 
void rule_neural_act_update (const struct XCSF *xcsf, const struct Cl *c, const double *x, const double *y)
 
size_t rule_neural_act_save (const struct XCSF *xcsf, const struct Cl *c, FILE *fp)
 
size_t rule_neural_act_load (const struct XCSF *xcsf, struct Cl *c, FILE *fp)
 
char * rule_neural_act_json_export (const struct XCSF *xcsf, const struct Cl *c)
 
void rule_neural_act_json_import (const struct XCSF *xcsf, struct Cl *c, const cJSON *json)
 

Variables

static struct CondVtbl const rule_neural_cond_vtbl
 Neural network rule condition implemented functions. More...
 
static struct ActVtbl const rule_neural_act_vtbl
 Neural network rule action implemented functions. More...
 

Detailed Description

Neural network rule (condition + action) functions.

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

Definition in file rule_neural.h.

Function Documentation

◆ rule_neural_act_compute()

int rule_neural_act_compute ( const struct XCSF xcsf,
const struct Cl c,
const double *  x 
)

Definition at line 238 of file rule_neural.c.

References clamp_int(), Cl::cond, Net::n_outputs, RuleNeural::net, and neural_output().

Referenced by rule_neural_act_cover().

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

◆ rule_neural_act_copy()

void rule_neural_act_copy ( const struct XCSF xcsf,
struct Cl dest,
const struct Cl src 
)

Definition at line 210 of file rule_neural.c.

◆ rule_neural_act_cover()

void rule_neural_act_cover ( const struct XCSF xcsf,
const struct Cl c,
const double *  x,
const int  action 
)

Definition at line 227 of file rule_neural.c.

References Cl::cond, RuleNeural::net, neural_rand(), rule_neural_act_compute(), and rule_neural_cond_match().

Here is the call graph for this function:

◆ rule_neural_act_crossover()

bool rule_neural_act_crossover ( const struct XCSF xcsf,
const struct Cl c1,
const struct Cl c2 
)

Definition at line 265 of file rule_neural.c.

◆ rule_neural_act_free()

void rule_neural_act_free ( const struct XCSF xcsf,
const struct Cl c 
)

Definition at line 203 of file rule_neural.c.

◆ rule_neural_act_general()

bool rule_neural_act_general ( const struct XCSF xcsf,
const struct Cl c1,
const struct Cl c2 
)

Definition at line 275 of file rule_neural.c.

◆ rule_neural_act_init()

void rule_neural_act_init ( const struct XCSF xcsf,
struct Cl c 
)

Definition at line 196 of file rule_neural.c.

◆ rule_neural_act_json_export()

char* rule_neural_act_json_export ( const struct XCSF xcsf,
const struct Cl c 
)

Definition at line 311 of file rule_neural.c.

Referenced by rule_neural_act_print().

Here is the caller graph for this function:

◆ rule_neural_act_json_import()

void rule_neural_act_json_import ( const struct XCSF xcsf,
struct Cl c,
const cJSON *  json 
)

Definition at line 323 of file rule_neural.c.

◆ rule_neural_act_load()

size_t rule_neural_act_load ( const struct XCSF xcsf,
struct Cl c,
FILE *  fp 
)

Definition at line 302 of file rule_neural.c.

◆ rule_neural_act_mutate()

bool rule_neural_act_mutate ( const struct XCSF xcsf,
const struct Cl c 
)

Definition at line 285 of file rule_neural.c.

◆ rule_neural_act_print()

void rule_neural_act_print ( const struct XCSF xcsf,
const struct Cl c 
)

Definition at line 219 of file rule_neural.c.

References rule_neural_act_json_export().

Here is the call graph for this function:

◆ rule_neural_act_save()

size_t rule_neural_act_save ( const struct XCSF xcsf,
const struct Cl c,
FILE *  fp 
)

Definition at line 293 of file rule_neural.c.

◆ rule_neural_act_update()

void rule_neural_act_update ( const struct XCSF xcsf,
const struct Cl c,
const double *  x,
const double *  y 
)

Definition at line 255 of file rule_neural.c.

◆ rule_neural_cond_copy()

void rule_neural_cond_copy ( const struct XCSF xcsf,
struct Cl dest,
const struct Cl src 
)

Definition at line 59 of file rule_neural.c.

References Cl::cond, RuleNeural::net, and neural_copy().

Here is the call graph for this function:

◆ rule_neural_cond_cover()

void rule_neural_cond_cover ( const struct XCSF xcsf,
const struct Cl c,
const double *  x 
)

Definition at line 70 of file rule_neural.c.

◆ rule_neural_cond_crossover()

bool rule_neural_cond_crossover ( const struct XCSF xcsf,
const struct Cl c1,
const struct Cl c2 
)

Definition at line 109 of file rule_neural.c.

◆ rule_neural_cond_free()

void rule_neural_cond_free ( const struct XCSF xcsf,
const struct Cl c 
)

Definition at line 50 of file rule_neural.c.

References Cl::cond, RuleNeural::net, and neural_free().

Here is the call graph for this function:

◆ rule_neural_cond_general()

bool rule_neural_cond_general ( const struct XCSF xcsf,
const struct Cl c1,
const struct Cl c2 
)

Definition at line 119 of file rule_neural.c.

◆ rule_neural_cond_init()

void rule_neural_cond_init ( const struct XCSF xcsf,
struct Cl c 
)

Definition at line 35 of file rule_neural.c.

References Cl::cond, and neural_create().

Here is the call graph for this function:

◆ rule_neural_cond_json_export()

char* rule_neural_cond_json_export ( const struct XCSF xcsf,
const struct Cl c 
)

Definition at line 164 of file rule_neural.c.

References Cl::cond, RuleNeural::net, and neural_json_export().

Referenced by rule_neural_cond_print().

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

◆ rule_neural_cond_json_import()

void rule_neural_cond_json_import ( const struct XCSF xcsf,
struct Cl c,
const cJSON *  json 
)

Definition at line 181 of file rule_neural.c.

References Cl::cond, RuleNeural::net, and neural_json_import().

Here is the call graph for this function:

◆ rule_neural_cond_load()

size_t rule_neural_cond_load ( const struct XCSF xcsf,
struct Cl c,
FILE *  fp 
)

Definition at line 154 of file rule_neural.c.

References Cl::cond, and neural_load().

Here is the call graph for this function:

◆ rule_neural_cond_match()

bool rule_neural_cond_match ( const struct XCSF xcsf,
const struct Cl c,
const double *  x 
)

Definition at line 89 of file rule_neural.c.

References Cl::cond, RuleNeural::net, neural_output(), and neural_propagate().

Referenced by rule_neural_act_cover().

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

◆ rule_neural_cond_mutate()

bool rule_neural_cond_mutate ( const struct XCSF xcsf,
const struct Cl c 
)

Definition at line 101 of file rule_neural.c.

References Cl::cond, RuleNeural::net, and neural_mutate().

Here is the call graph for this function:

◆ rule_neural_cond_print()

void rule_neural_cond_print ( const struct XCSF xcsf,
const struct Cl c 
)

Definition at line 129 of file rule_neural.c.

References rule_neural_cond_json_export().

Here is the call graph for this function:

◆ rule_neural_cond_save()

size_t rule_neural_cond_save ( const struct XCSF xcsf,
const struct Cl c,
FILE *  fp 
)

Definition at line 145 of file rule_neural.c.

References Cl::cond, RuleNeural::net, and neural_save().

Here is the call graph for this function:

◆ rule_neural_cond_size()

double rule_neural_cond_size ( const struct XCSF xcsf,
const struct Cl c 
)

Definition at line 137 of file rule_neural.c.

References Cl::cond, RuleNeural::net, and neural_size().

Here is the call graph for this function:

◆ rule_neural_cond_update()

void rule_neural_cond_update ( const struct XCSF xcsf,
const struct Cl c,
const double *  x,
const double *  y 
)

Definition at line 79 of file rule_neural.c.

Variable Documentation

◆ rule_neural_act_vtbl

struct ActVtbl const rule_neural_act_vtbl
static
Initial value:
= {
}
bool rule_neural_act_crossover(const struct XCSF *xcsf, const struct Cl *c1, const struct Cl *c2)
Definition: rule_neural.c:265
char * rule_neural_act_json_export(const struct XCSF *xcsf, const struct Cl *c)
Definition: rule_neural.c:311
size_t rule_neural_act_save(const struct XCSF *xcsf, const struct Cl *c, FILE *fp)
Definition: rule_neural.c:293
void rule_neural_act_init(const struct XCSF *xcsf, struct Cl *c)
Definition: rule_neural.c:196
void rule_neural_act_update(const struct XCSF *xcsf, const struct Cl *c, const double *x, const double *y)
Definition: rule_neural.c:255
void rule_neural_act_json_import(const struct XCSF *xcsf, struct Cl *c, const cJSON *json)
Definition: rule_neural.c:323
void rule_neural_act_free(const struct XCSF *xcsf, const struct Cl *c)
Definition: rule_neural.c:203
size_t rule_neural_act_load(const struct XCSF *xcsf, struct Cl *c, FILE *fp)
Definition: rule_neural.c:302
bool rule_neural_act_mutate(const struct XCSF *xcsf, const struct Cl *c)
Definition: rule_neural.c:285
void rule_neural_act_copy(const struct XCSF *xcsf, struct Cl *dest, const struct Cl *src)
Definition: rule_neural.c:210
bool rule_neural_act_general(const struct XCSF *xcsf, const struct Cl *c1, const struct Cl *c2)
Definition: rule_neural.c:275
int rule_neural_act_compute(const struct XCSF *xcsf, const struct Cl *c, const double *x)
Definition: rule_neural.c:238
void rule_neural_act_cover(const struct XCSF *xcsf, const struct Cl *c, const double *x, const int action)
Definition: rule_neural.c:227
void rule_neural_act_print(const struct XCSF *xcsf, const struct Cl *c)
Definition: rule_neural.c:219

Neural network rule action implemented functions.

Definition at line 150 of file rule_neural.h.

Referenced by condition_set().

◆ rule_neural_cond_vtbl

struct CondVtbl const rule_neural_cond_vtbl
static
Initial value:
= {
}
bool rule_neural_cond_match(const struct XCSF *xcsf, const struct Cl *c, const double *x)
Definition: rule_neural.c:89
size_t rule_neural_cond_load(const struct XCSF *xcsf, struct Cl *c, FILE *fp)
Definition: rule_neural.c:154
size_t rule_neural_cond_save(const struct XCSF *xcsf, const struct Cl *c, FILE *fp)
Definition: rule_neural.c:145
bool rule_neural_cond_crossover(const struct XCSF *xcsf, const struct Cl *c1, const struct Cl *c2)
Definition: rule_neural.c:109
void rule_neural_cond_print(const struct XCSF *xcsf, const struct Cl *c)
Definition: rule_neural.c:129
bool rule_neural_cond_mutate(const struct XCSF *xcsf, const struct Cl *c)
Definition: rule_neural.c:101
void rule_neural_cond_json_import(const struct XCSF *xcsf, struct Cl *c, const cJSON *json)
Definition: rule_neural.c:181
void rule_neural_cond_free(const struct XCSF *xcsf, const struct Cl *c)
Definition: rule_neural.c:50
void rule_neural_cond_update(const struct XCSF *xcsf, const struct Cl *c, const double *x, const double *y)
Definition: rule_neural.c:79
char * rule_neural_cond_json_export(const struct XCSF *xcsf, const struct Cl *c)
Definition: rule_neural.c:164
bool rule_neural_cond_general(const struct XCSF *xcsf, const struct Cl *c1, const struct Cl *c2)
Definition: rule_neural.c:119
void rule_neural_cond_init(const struct XCSF *xcsf, struct Cl *c)
Definition: rule_neural.c:35
void rule_neural_cond_copy(const struct XCSF *xcsf, struct Cl *dest, const struct Cl *src)
Definition: rule_neural.c:59
double rule_neural_cond_size(const struct XCSF *xcsf, const struct Cl *c)
Definition: rule_neural.c:137
void rule_neural_cond_cover(const struct XCSF *xcsf, const struct Cl *c, const double *x)
Definition: rule_neural.c:70

Neural network rule condition implemented functions.

Definition at line 87 of file rule_neural.h.

Referenced by condition_set().