2018-03-30 13:04:37 -07:00
|
|
|
#pragma once
|
2018-03-28 20:41:08 -07:00
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
2018-03-30 13:04:37 -07:00
|
|
|
double* w; // Weights.
|
|
|
|
double* b; // Biases.
|
|
|
|
double* h; // Hidden layer.
|
|
|
|
double* o; // Output layer.
|
|
|
|
|
|
|
|
// Number of biases - always two - Tinn only supports a single hidden layer.
|
2018-03-29 14:32:11 -07:00
|
|
|
int nb;
|
2018-03-30 13:04:37 -07:00
|
|
|
|
|
|
|
int nips; // Number of inputs.
|
|
|
|
int nhid; // Number of hidden neurons.
|
|
|
|
int nops; // Number of outputs.
|
2018-03-28 20:41:08 -07:00
|
|
|
}
|
|
|
|
Tinn;
|
|
|
|
|
2018-03-30 13:04:37 -07:00
|
|
|
double xttrain(const Tinn, const double* in, const double* tg, double rate);
|
2018-03-28 20:41:08 -07:00
|
|
|
|
2018-03-30 13:04:37 -07:00
|
|
|
Tinn xtbuild(int nips, int nhid, int nops);
|
2018-03-28 20:41:08 -07:00
|
|
|
|
2018-03-30 13:04:37 -07:00
|
|
|
void xtfree(Tinn);
|
2018-03-28 20:41:08 -07:00
|
|
|
|
2018-03-30 13:04:37 -07:00
|
|
|
double* xpredict(const Tinn, const double* in);
|