2024-07-06 15:59:22 +00:00
|
|
|
#ifndef NEURAL_H
|
|
|
|
#define NEURAL_H
|
|
|
|
|
|
|
|
typedef struct _neuron {
|
|
|
|
float value;
|
2024-10-19 09:32:39 +00:00
|
|
|
float *synapses; // Synapses of the neuron towards the next layer,
|
|
|
|
// NULL if output layer
|
2024-07-06 15:59:22 +00:00
|
|
|
} Neuron;
|
|
|
|
|
2024-10-12 09:17:52 +00:00
|
|
|
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;
|
|
|
|
|
2024-07-06 15:59:22 +00:00
|
|
|
typedef struct _neural_network {
|
2024-10-12 09:17:52 +00:00
|
|
|
Neural_Layer **layers;
|
|
|
|
ssize_t layer_count;
|
2024-07-06 15:59:22 +00:00
|
|
|
} Neural_Network;
|
|
|
|
|
2024-10-29 16:07:08 +00:00
|
|
|
typedef struct _neural_data {
|
|
|
|
float *neural_vector;
|
|
|
|
size_t vect_len;
|
|
|
|
float *synapse_matrix;
|
|
|
|
size_t mat_len;
|
|
|
|
} Neural_Data;
|
|
|
|
|
2024-10-12 09:17:52 +00:00
|
|
|
Neural_Network *neural_new(size_t, size_t, size_t);
|
2024-11-11 16:42:57 +00:00
|
|
|
void neural_free(Neural_Network *);
|
2024-07-06 15:59:22 +00:00
|
|
|
void neural_randomize(Neural_Network *);
|
|
|
|
float *neural_process(Neural_Network *, float *);
|
2024-10-29 16:07:08 +00:00
|
|
|
Neural_Data *neural_getData(Neural_Network *, size_t);
|
|
|
|
int neural_getMesh(Neural_Network *, ModelRegistry *);
|
2024-07-06 15:59:22 +00:00
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|