ANN  0.1.1.5
A library containing multiple neural network models written in C
neuron.h
Go to the documentation of this file.
1 
11 #ifndef _ANN_MODELS_PCFNN_NEURON_H_
12 #define _ANN_MODELS_PCFNN_NEURON_H_
13 
14 #include "../../config.h"
15 #include <stdlib.h>
16 
17 
25 };
26 
27 
35 typedef struct PCFNN_NEURON {
36  size_t size;
37  double *weights;
38  double bias, output;
39  // INTERNAL
41  double *wdelta, *lastdw;
42  struct PCFNN_NEURON **inputs;
43  double(*f_init)();
44  double(*f_act)(double);
45  double(*f_act_de)(double);
47 } PCFNN_NEURON;
48 
49 
59 struct PCFNN_NEURON *PCFNN_NEURON_new(size_t size, double(*f_init)(), double(*f_act)(double), double(*f_act_de)(double));
60 
61 
67 void PCFNN_NEURON_clear(struct PCFNN_NEURON *n);
68 
69 
75 void PCFNN_NEURON_free(struct PCFNN_NEURON *n);
76 
77 
84 void PCFNN_NEURON_addinputs(struct PCFNN_NEURON *n, size_t inputs);
85 
86 
92 void PCFNN_NEURON_build(struct PCFNN_NEURON *n);
93 
94 
101 size_t PCFNN_NEURON_get_ram_usage(struct PCFNN_NEURON *n);
102 
103 
110 struct PCFNN_NEURON *PCFNN_NEURON_clone(struct PCFNN_NEURON *n);
111 
112 
120 
121 
129 
130 
137 void PCFNN_NEURON_summary(struct PCFNN_NEURON *n, size_t param[2]);
138 
139 
140 #endif /* _ANN_MODELS_PCFNN_NEURON_H_ */
double delta
Definition: neuron.h:40
Neuron unit.
Definition: neuron.h:35
double dsum
Definition: neuron.h:40
double bdelta
Definition: neuron.h:40
void PCFNN_NEURON_free(struct PCFNN_NEURON *n)
Free all memory allocation of an PCFNN_NEURON.
Definition: neuron.c:28
double activation
Definition: neuron.h:40
void PCFNN_NEURON_clear(struct PCFNN_NEURON *n)
Clear a PCFNN_NEURON.
Definition: neuron.c:21
struct PCFNN_NEURON * PCFNN_NEURON_clone(struct PCFNN_NEURON *n)
Copy the input size, initialisation function and activation function from n and create a new PCFNN_NE...
Definition: neuron.c:70
struct PCFNN_NEURON ** inputs
Definition: neuron.h:42
double output
Definition: neuron.h:38
double(* f_act_de)(double)
Definition: neuron.h:45
struct PCFNN_NEURON * PCFNN_NEURON_new(size_t size, double(*f_init)(), double(*f_act)(double), double(*f_act_de)(double))
Initialize a PCFNN_NEURON.
Definition: neuron.c:6
struct PCFNN_NEURON * PCFNN_NEURON_clone_all(struct PCFNN_NEURON *n)
Copy all data from n and create a new PCFNN_NEURON.
Definition: neuron.c:77
void PCFNN_NEURON_build(struct PCFNN_NEURON *n)
Initialize all internal data of a PCFNN_NEURON.
Definition: neuron.c:48
void PCFNN_NEURON_summary(struct PCFNN_NEURON *n, size_t param[2])
Write on param the number of unlocked parameters and locked parameters.
Definition: neuron.c:103
void PCFNN_NEURON_addinputs(struct PCFNN_NEURON *n, size_t inputs)
Increase the input size of the PCFNN_NEURON.
Definition: neuron.c:41
double * lastdw
Definition: neuron.h:41
void PCFNN_NEURON_set_state_lock(struct PCFNN_NEURON *n, enum PCFNN_NEURON_LOCK_STATE state)
Set lock state of the neuron n.
Definition: neuron.c:97
struct PCFNN_NEURON PCFNN_NEURON
size_t PCFNN_NEURON_get_ram_usage(struct PCFNN_NEURON *n)
Give the number of bytes used by the PCFNN_NEURON n.
Definition: neuron.c:60
double(* f_init)()
Definition: neuron.h:43
double bias
Definition: neuron.h:38
double * weights
Definition: neuron.h:37
double * wdelta
Definition: neuron.h:41
double(* f_act)(double)
Definition: neuron.h:44
enum PCFNN_NEURON_LOCK_STATE state
Definition: neuron.h:46
size_t size
Definition: neuron.h:36
PCFNN_NEURON_LOCK_STATE
Lock state of a neuron.
Definition: neuron.h:22