XCSF 1.4.8
XCSF learning classifier system
Loading...
Searching...
No Matches
rule_neural.h
Go to the documentation of this file.
1/*
2 * This program is free software: you can redistribute it and/or modify
3 * it under the terms of the GNU General Public License as published by
4 * the Free Software Foundation, either version 3 of the License, or
5 * (at your option) any later version.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
11 *
12 * You should have received a copy of the GNU General Public License
13 * along with this program. If not, see <http://www.gnu.org/licenses/>.
14 */
15
24#pragma once
25
26#include "action.h"
27#include "condition.h"
28#include "neural.h"
29#include "xcsf.h"
30
34struct RuleNeural {
35 struct Net net;
36};
37
38bool
39rule_neural_cond_crossover(const struct XCSF *xcsf, const struct Cl *c1,
40 const struct Cl *c2);
41
42bool
43rule_neural_cond_general(const struct XCSF *xcsf, const struct Cl *c1,
44 const struct Cl *c2);
45
46bool
47rule_neural_cond_match(const struct XCSF *xcsf, const struct Cl *c,
48 const double *x);
49
50bool
51rule_neural_cond_mutate(const struct XCSF *xcsf, const struct Cl *c);
52
53void
54rule_neural_cond_copy(const struct XCSF *xcsf, struct Cl *dest,
55 const struct Cl *src);
56
57void
58rule_neural_cond_cover(const struct XCSF *xcsf, const struct Cl *c,
59 const double *x);
60
61void
62rule_neural_cond_free(const struct XCSF *xcsf, const struct Cl *c);
63
64void
65rule_neural_cond_init(const struct XCSF *xcsf, struct Cl *c);
66
67void
68rule_neural_cond_print(const struct XCSF *xcsf, const struct Cl *c);
69
70void
71rule_neural_cond_update(const struct XCSF *xcsf, const struct Cl *c,
72 const double *x, const double *y);
73
74double
75rule_neural_cond_size(const struct XCSF *xcsf, const struct Cl *c);
76
77size_t
78rule_neural_cond_save(const struct XCSF *xcsf, const struct Cl *c, FILE *fp);
79
80size_t
81rule_neural_cond_load(const struct XCSF *xcsf, struct Cl *c, FILE *fp);
82
83char *
84rule_neural_cond_json_export(const struct XCSF *xcsf, const struct Cl *c);
85
86void
87rule_neural_cond_json_import(const struct XCSF *xcsf, struct Cl *c,
88 const cJSON *json);
89
103
104bool
105rule_neural_act_crossover(const struct XCSF *xcsf, const struct Cl *c1,
106 const struct Cl *c2);
107
108bool
109rule_neural_act_general(const struct XCSF *xcsf, const struct Cl *c1,
110 const struct Cl *c2);
111
112bool
113rule_neural_act_mutate(const struct XCSF *xcsf, const struct Cl *c);
114
115int
116rule_neural_act_compute(const struct XCSF *xcsf, const struct Cl *c,
117 const double *x);
118
119void
120rule_neural_act_copy(const struct XCSF *xcsf, struct Cl *dest,
121 const struct Cl *src);
122
123void
124rule_neural_act_cover(const struct XCSF *xcsf, const struct Cl *c,
125 const double *x, const int action);
126
127void
128rule_neural_act_free(const struct XCSF *xcsf, const struct Cl *c);
129
130void
131rule_neural_act_init(const struct XCSF *xcsf, struct Cl *c);
132
133void
134rule_neural_act_print(const struct XCSF *xcsf, const struct Cl *c);
135
136void
137rule_neural_act_update(const struct XCSF *xcsf, const struct Cl *c,
138 const double *x, const double *y);
139
140size_t
141rule_neural_act_save(const struct XCSF *xcsf, const struct Cl *c, FILE *fp);
142
143size_t
144rule_neural_act_load(const struct XCSF *xcsf, struct Cl *c, FILE *fp);
145
146char *
147rule_neural_act_json_export(const struct XCSF *xcsf, const struct Cl *c);
148
149void
150rule_neural_act_json_import(const struct XCSF *xcsf, struct Cl *c,
151 const cJSON *json);
152
Interface for classifier actions.
Interface for classifier conditions.
An implementation of a multi-layer perceptron neural network.
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)
bool rule_neural_act_crossover(const struct XCSF *xcsf, const struct Cl *c1, const struct Cl *c2)
size_t rule_neural_cond_save(const struct XCSF *xcsf, const struct Cl *c, FILE *fp)
size_t rule_neural_act_save(const struct XCSF *xcsf, const struct Cl *c, FILE *fp)
static struct ActVtbl const rule_neural_act_vtbl
Neural network rule action implemented functions.
void rule_neural_act_init(const struct XCSF *xcsf, struct Cl *c)
char * rule_neural_act_json_export(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)
bool rule_neural_cond_crossover(const struct XCSF *xcsf, const struct Cl *c1, const struct Cl *c2)
static struct CondVtbl const rule_neural_cond_vtbl
Neural network rule condition implemented functions.
Definition rule_neural.h:93
void rule_neural_cond_print(const struct XCSF *xcsf, const struct Cl *c)
bool rule_neural_cond_mutate(const struct XCSF *xcsf, const struct Cl *c)
void rule_neural_cond_json_import(const struct XCSF *xcsf, struct Cl *c, const cJSON *json)
void rule_neural_act_json_import(const struct XCSF *xcsf, struct Cl *c, const cJSON *json)
void rule_neural_cond_free(const struct XCSF *xcsf, const struct Cl *c)
Definition rule_neural.c:50
void rule_neural_act_free(const struct XCSF *xcsf, const struct Cl *c)
size_t rule_neural_act_load(const struct XCSF *xcsf, struct Cl *c, FILE *fp)
bool rule_neural_act_mutate(const struct XCSF *xcsf, const struct Cl *c)
char * rule_neural_cond_json_export(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)
Definition rule_neural.c:79
void rule_neural_act_copy(const struct XCSF *xcsf, struct Cl *dest, const struct Cl *src)
bool rule_neural_act_general(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)
void rule_neural_cond_init(const struct XCSF *xcsf, struct Cl *c)
Definition rule_neural.c:35
int rule_neural_act_compute(const struct XCSF *xcsf, const struct Cl *c, const double *x)
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)
void rule_neural_cond_cover(const struct XCSF *xcsf, const struct Cl *c, const double *x)
Definition rule_neural.c:70
void rule_neural_act_cover(const struct XCSF *xcsf, const struct Cl *c, const double *x, const int action)
void rule_neural_act_print(const struct XCSF *xcsf, const struct Cl *c)
Action interface data structure.
Definition action.h:76
Classifier data structure.
Definition xcsf.h:45
Condition interface data structure.
Definition condition.h:104
Neural network data structure.
Definition neural.h:48
Neural network rule data structure.
Definition rule_neural.h:34
struct Net net
Neural network.
Definition rule_neural.h:35
XCSF data structure.
Definition xcsf.h:85
XCSF data structures.