-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathneunet.h
More file actions
32 lines (27 loc) · 723 Bytes
/
neunet.h
File metadata and controls
32 lines (27 loc) · 723 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#define MAXLAYER 64
/* R^n -> R^n function (vector field) */
typedef void (*vfield)(double *y, double *x, int n);
/* Derivative of vfield */
typedef void (*dvfield)(void *y, double *x, int n);
struct layer {
int n;
double **wm;
double *bv;
double *iv;
double *ov;
double *di;
double **dw;
double *db;
double **jact;
vfield act;
dvfield dact;
int xact;
};
extern struct layer net[MAXLAYER];
extern int nlayer;
extern double (*lossf)(double *ov, double *tv, int n);
extern void (*dlossf)(double *dv, double *ov, double *tv, int n);
void addlayer(int n, vfield act, dvfield dact, int xact);
void netinit(int train);
void learn(double **iv, double **tv, int n, double lr, double l2);
void feedfwd(double *iv);