summaryrefslogtreecommitdiffstats
path: root/mixer.h
blob: c0808b323111ef1575c064597fd923c9868dd585 (plain)
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
#ifndef _MIXER_H
#define _MIXER_H

#include "util.h"

struct nn_t {
        int N;        /* Number of inputs to each neural network */
        int M;        /* Number of neural networks */
        int S;        /* Number of selectable inputs */
        short *tx;    /* Input vector */
        short *wx;    /* Weight vector */
        int *pr;      /* Probability vector */
        int *ctx;     /* Context hashes (index) */
        int head;     /* Write head (index) for input arrays */ 
        int base;     /* Value related to maximum value of input datatypes */
        int nx;       /* Length of @tx, @wx, and @pr vectors */
        struct nn_t *nn_ptr; /* Another neural network mixer */
};

void nn_init   (struct nn_t *nn, int n, int m, int s, int w);
void nn_train  (struct nn_t *nn, int bit);
void nn_input  (struct nn_t *nn, int input);
void nn_set    (struct nn_t *nn, int context, int range);
int  nn_predict(struct nn_t *nn, int bit);

#endif