DEV Community

Cover image for C++ Neural Network in a Weekend
Jeremy Ong
Jeremy Ong

Posted on

4 1

C++ Neural Network in a Weekend

There are tons of ML/AI frameworks to choose from right now (Tensorflow, Keras, Pytorch, etc). However, sometimes, building things completely from scratch is still the best way to learn how something works. To help people seeking to to this, I created a neural network in a weekend in C++ without any external dependencies. No matrix libraries, no linear algebra subroutines, nada, zilch.

The code for the repository is here. I also wrote a paper tutorial walking through the math (the derivations) and the implementation hosted in the same repository here. The paper is... a bit on the long side at 42 pages, but it's meant to be entirely self-contained. Again, from scratch!

In addition, the code is pretty heavily annotated with comments, so should hopefully be easy to following along, but please leave a question/comment if you get stuck. Happy hacking!

Image of Datadog

The Essential Toolkit for Front-end Developers

Take a user-centric approach to front-end monitoring that evolves alongside increasingly complex frameworks and single-page applications.

Get The Kit

Top comments (1)

Collapse
 
jeremyong profile image
Jeremy Ong

Also, while this is written in C++, you should be able to follow along in any language, so feel free to share it if you do :)

The Most Contextual AI Development Assistant

Pieces.app image

Our centralized storage agent works on-device, unifying various developer tools to proactively capture and enrich useful materials, streamline collaboration, and solve complex problems through a contextual understanding of your unique workflow.

👥 Ideal for solo developers, teams, and cross-company projects

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay