tinn/Tinn.h

26 lines
557 B
C
Raw Normal View History

2018-03-30 23:04:37 +03:00
#pragma once
2018-03-29 06:41:08 +03:00
typedef struct
{
2018-03-30 23:04:37 +03: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-30 00:32:11 +03:00
int nb;
2018-03-30 23:04:37 +03:00
int nips; // Number of inputs.
int nhid; // Number of hidden neurons.
int nops; // Number of outputs.
2018-03-29 06:41:08 +03:00
}
Tinn;
2018-03-30 23:04:37 +03:00
double xttrain(const Tinn, const double* in, const double* tg, double rate);
2018-03-29 06:41:08 +03:00
2018-03-30 23:04:37 +03:00
Tinn xtbuild(int nips, int nhid, int nops);
2018-03-29 06:41:08 +03:00
2018-03-30 23:04:37 +03:00
void xtfree(Tinn);
2018-03-29 06:41:08 +03:00
2018-03-30 23:04:37 +03:00
double* xpredict(const Tinn, const double* in);