-
Notifications
You must be signed in to change notification settings - Fork 188
/
Tinn.h
40 lines (32 loc) · 780 Bytes
/
Tinn.h
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
33
34
35
36
37
38
39
40
#pragma once
typedef struct
{
// All the weights.
float* w;
// Hidden to output layer weights.
float* x;
// Biases.
float* b;
// Hidden layer.
float* h;
// Output layer.
float* o;
// Number of biases - always two - Tinn only supports a single hidden layer.
int nb;
// Number of weights.
int nw;
// Number of inputs.
int nips;
// Number of hidden neurons.
int nhid;
// Number of outputs.
int nops;
}
Tinn;
float* xtpredict(Tinn, const float* in);
float xttrain(Tinn, const float* in, const float* tg, float rate);
Tinn xtbuild(int nips, int nhid, int nops);
void xtsave(Tinn, const char* path);
Tinn xtload(const char* path);
void xtfree(Tinn);
void xtprint(const float* arr, const int size);