CX/include/neural.h

27 lines
643 B
C

#ifndef NEURAL_H
#define NEURAL_H
typedef struct _neuron {
float value;
float *weights; // Biases 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;
Neural_Network *neural_new(size_t, size_t, size_t);
void neural_randomize(Neural_Network *);
float *neural_process(Neural_Network *, float *);
#endif