Marcel Plch
9a05ae3841
I have no clue how these bugs happened. I have no clue what was the issue exacly. All I know is that I have multiplied wrong indeces with wrong dimensions. Guess even this is maths sometimes.
40 lines
1.1 KiB
C
40 lines
1.1 KiB
C
#ifndef NEURAL_H
|
|
#define NEURAL_H
|
|
|
|
typedef struct _neuron {
|
|
float value;
|
|
float *synapses; // Synapses of the neuron towards the next layer,
|
|
// NULL if output layer
|
|
} Neuron;
|
|
|
|
typedef struct _neural_layer {
|
|
Neuron *neurons;
|
|
size_t layer_size; // Neurons Per Layer
|
|
size_t layer_size_next; // Neurons in next layer, 0 if output layer,
|
|
} Neural_Layer;
|
|
|
|
typedef struct _neural_network {
|
|
Neural_Layer **layers;
|
|
ssize_t layer_count;
|
|
} Neural_Network;
|
|
|
|
typedef struct _neural_data {
|
|
float *neural_vector;
|
|
size_t vect_len;
|
|
float *synapse_matrix;
|
|
size_t mat_len;
|
|
} Neural_Data;
|
|
|
|
Neural_Network *neural_new(size_t, size_t, size_t);
|
|
void neural_free(Neural_Network *);
|
|
void neural_populate_sequential(Neural_Network *);
|
|
void neural_randomize(Neural_Network *);
|
|
float *neural_loadData(Neural_Network *, const char *);
|
|
float *neural_process(Neural_Network *, float *);
|
|
Neural_Data *neural_getData(Neural_Network *, size_t);
|
|
int neural_getMesh(Neural_Network *, ModelRegistry *);
|
|
char *neural_getXML(Neural_Network *);
|
|
|
|
#endif
|
|
|
|
|