46 lines
1.3 KiB
Markdown
46 lines
1.3 KiB
Markdown
# Extension: Artificial Neural Networks in C
|
|
|
|
## Folder Structure
|
|
|
|
- src: Contains the source code for the project. Two modules: `matrix` and `network`.
|
|
- tests: Contains unit and integration tests for the project.
|
|
* `test_matrix.c`: Unit tests for the `matrix` module.
|
|
* `test_network.c`: Unit tests for the `network` module.
|
|
* `test_xor`: Integration tests for a full neural network to learn the XOR function.
|
|
- examples: An example of a non-trivial neural network that learns to recognize handwritten digits. The network is trained on the MNIST dataset, with about 100K training examples.
|
|
- client: Contains a simple interface in python to interact with the neural network. You can there draw a digit and the network will try to recognize it in real time! Give it a go!
|
|
|
|
## Building the Project
|
|
|
|
To build the project, run the following commands:
|
|
|
|
```bash
|
|
make
|
|
```
|
|
|
|
## Running the Tests
|
|
|
|
To run the tests, run the following commands:
|
|
|
|
```
|
|
./build/test_matrix
|
|
./build/test_network
|
|
./build/test_xor
|
|
./build/test_mnist
|
|
```
|
|
|
|
As it stands, the mnist has about 98% accuracy!
|
|
```
|
|
====================================
|
|
Accuracy: 0.976300
|
|
====================================
|
|
```
|
|
|
|
## Running the client
|
|
|
|
To run the client, run the following commands:
|
|
|
|
```
|
|
cd client
|
|
python mnist_client.py
|
|
``` |