Skip to content

ebridges/minimal-neural-network

Folders and files

NameName
Last commit message
Last commit date

Latest commit

459565a · Jan 31, 2025

History

28 Commits
Sep 30, 2024
Sep 30, 2024
Sep 30, 2024
Sep 30, 2024
Sep 30, 2024
Sep 30, 2024
Sep 23, 2024
Jan 31, 2025
Sep 26, 2024
Sep 26, 2024
Sep 25, 2024

Repository files navigation

Minimal Neural Network

This is an implementation of a simple neural network using only the C standard library. It's trained with the MNIST archive of handwritten numbers. The trained model is saved off in a platform independent way to be used by a Python lambda that does actual predictions using a simple HTML/JS user interface.

It consists of three layers:

  • Input layer which accepts 28x28 pixel images flattened into a 784 dimensional vector.
  • Hidden layer containing 256 neurons.
  • Output layer containing 10 neurons -- one for each class of digit to be predicted.

Training

The model was trained with the dataset over 100 epochs. Based on that, it's clear that subsequent epochs past 50 don't increase the accuracy significantly.

Info

  • Neural network implemented & trained in ANSI C.
  • Plot generated using Python & Matplotlib.
  • User interface implemented in Javascript/HTML/CSS.
  • Prediction service implemented as a Python lambda.
  • Deployment to AWS using Terraform to create & configure lambdas & API gateway.

References

About

Minimal neural network implemented & trained in C.

Resources

License

Stars

Watchers

Forks

Languages