Skip to content

williamjizihe/NeuralNetC

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Neural Networks written in C

This work is related to the IN104 project at ENSTA Paris, specifically focusing on the implementation and testing of the neural network component.

Usage

Modify the network.h and network.c file to change the network architecture. It relies on the ndarray and layer files.

Support layer types:

  • Dense
  • Conv
  • Flatten

Support activation functions:

  • ReLU
  • Softmax

Support loss functions:

  • MSE
  • Cross Entropy

Examples

The dataset used in the examples is the 20x20 MNIST dataset.

To train the network, run the following command:

cd ./examples
make
./mnist_train.x

The log file is saved in the ../logs directory as log_<timestamp>.txt.

To test the network, run the following command:

./mnist_test.x <path_to_model>

The model is saved in the ../models directory as network_<timestamp>.txt. The file ../models/network_network_2023_5_18_18_47_42.txt is a trained model.

Then enter the index of the image in the test dataset you want to test, for example 0.341.

About

Neural Networks written in C

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors