Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
696990187f
|
|||
|
e5d0e4b5f6
|
|||
|
1b64ad6df5
|
@@ -1,19 +1,20 @@
|
||||
CC := gcc
|
||||
CCFLAGS := -pedantic -std=c99
|
||||
CCFLAGS := -std=c99
|
||||
LDFLAGS := -lm
|
||||
OBJ := main.o
|
||||
TARGET := main
|
||||
|
||||
all: main use
|
||||
|
||||
main: $(OBJ)
|
||||
$(CC) $(CCFLAGS) $(OBJ) -o $(TARGET)
|
||||
$(CC) $(CCFLAGS) $(OBJ) -o $(TARGET) $(LDFLAGS)
|
||||
./main
|
||||
|
||||
$(OBJ): main.c
|
||||
$(CC) $(CCFLAGS) -c main.c -o $(OBJ)
|
||||
|
||||
use: use.o
|
||||
$(CC) $(CCFLAGS) use.o -o use
|
||||
$(CC) $(CCFLAGS) use.o -o use $(LDFLAGS)
|
||||
|
||||
use.o: use.c
|
||||
$(CC) $(CCFLAGS) -c use.c -o use.o
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
# XOR Neural Network
|
||||
# NXOR Neural Network
|
||||
## How to use
|
||||
1. Build and train the model
|
||||
```bash
|
||||
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
|
||||
```bash
|
||||
./use [value1] [value2]
|
||||
|
||||
@@ -79,7 +79,7 @@ int main(){
|
||||
double trainingInputs[NUM_TRAINING_SETS][NUM_INPUTS] = {{0.0f, 0.0f}, {1.0f, 0.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 j = 0; j < NUM_HIDDEN; j++){
|
||||
|
||||
Reference in New Issue
Block a user