3 Commits

Author SHA1 Message Date
lga 696990187f fix: remove pedantic flags 2024-11-05 12:25:30 +01:00
lga e5d0e4b5f6 docs: 📝 Change documentation for NXOR 2024-11-02 15:47:53 +01:00
lga 1b64ad6df5 feat: Change to resolve the non xor 2024-11-02 15:46:25 +01:00
4 changed files with 7 additions and 7 deletions
+4 -3
View File
@@ -1,19 +1,20 @@
CC := gcc CC := gcc
CCFLAGS := -pedantic -std=c99 CCFLAGS := -std=c99
LDFLAGS := -lm
OBJ := main.o OBJ := main.o
TARGET := main TARGET := main
all: main use all: main use
main: $(OBJ) main: $(OBJ)
$(CC) $(CCFLAGS) $(OBJ) -o $(TARGET) $(CC) $(CCFLAGS) $(OBJ) -o $(TARGET) $(LDFLAGS)
./main ./main
$(OBJ): main.c $(OBJ): main.c
$(CC) $(CCFLAGS) -c main.c -o $(OBJ) $(CC) $(CCFLAGS) -c main.c -o $(OBJ)
use: use.o use: use.o
$(CC) $(CCFLAGS) use.o -o use $(CC) $(CCFLAGS) use.o -o use $(LDFLAGS)
use.o: use.c use.o: use.c
$(CC) $(CCFLAGS) -c use.c -o use.o $(CC) $(CCFLAGS) -c use.c -o use.o
+2 -2
View File
@@ -1,10 +1,10 @@
# XOR Neural Network # NXOR Neural Network
## How to use ## How to use
1. Build and train the model 1. Build and train the model
```bash ```bash
make all make all
``` ```
> By default the model is train on 1000000 epochs, you can change this value in the [main.c](https://gitea.louisgallet.fr/lgallet/XOR-NeuralNetwork-C/src/branch/master/main.c#L106) file, line 106. > By default the model is train on 1000000 epochs, you can change this value in the [main.c](https://gitea.louisgallet.fr/OCRudoku/NXOR-NeuralNetwork-C/src/branch/master/main.c#L106) file, line 106.
2. Run the model 2. Run the model
```bash ```bash
./use [value1] [value2] ./use [value1] [value2]
+1 -1
View File
@@ -79,7 +79,7 @@ int main(){
double trainingInputs[NUM_TRAINING_SETS][NUM_INPUTS] = {{0.0f, 0.0f}, {1.0f, 0.0f}, double trainingInputs[NUM_TRAINING_SETS][NUM_INPUTS] = {{0.0f, 0.0f}, {1.0f, 0.0f},
{0.0f, 1.0f}, {1.0f, 1.0f}}; {0.0f, 1.0f}, {1.0f, 1.0f}};
double trainingOutputs[NUM_TRAINING_SETS][NUM_OUTPUTS] = {{0.0f}, {1.0f}, {1.0f}, {0.0f}}; double trainingOutputs[NUM_TRAINING_SETS][NUM_OUTPUTS] = {{1.0f}, {0.0f}, {0.0f}, {1.0f}};
for(int i = 0; i < NUM_INPUTS; i++){ for(int i = 0; i < NUM_INPUTS; i++){
for(int j = 0; j < NUM_HIDDEN; j++){ for(int j = 0; j < NUM_HIDDEN; j++){
-1
View File
@@ -4,7 +4,6 @@
#ifndef MAIN_H #ifndef MAIN_H
#define MAIN_H #define MAIN_H
#include <sys/_types/_size_t.h>
#include <math.h> #include <math.h>
#include <stdlib.h> #include <stdlib.h>