feat: Create Neural network for XOR

This commit is contained in:
2024-09-27 18:00:01 +02:00
commit 82b65ae2a1
7 changed files with 698 additions and 0 deletions

26
main.h Normal file
View File

@ -0,0 +1,26 @@
//
// Created by Louis Gallet on 24/09/2024.
//
#ifndef MAIN_H
#define MAIN_H
#include <sys/_types/_size_t.h>
#include <math.h>
#include <stdlib.h>
#define NUM_INPUTS 2
#define NUM_HIDDEN 2
#define NUM_OUTPUTS 1
#define NUM_TRAINING_SETS 4
double sigmoid(double x);
double sigmoid_derivative(double x);
double init_weights();
void shuffle(int *array, size_t n);
void backup_weights(char filename[], double hiddenWeights[NUM_INPUTS][NUM_HIDDEN], double hiddenLayerBias[NUM_HIDDEN],
double outputWeights[NUM_HIDDEN][NUM_OUTPUTS], double outputLayerBias[NUM_OUTPUTS]);
int main();
#endif //MAIN_H