TGViewer
C++ - Reddit C++ - Reddit @r_cpp · 230 subscribers
Post #25260 12
Building a C++ Neural Network Library from Scratch (Because I Couldn't Stand Python)

Hey everyone,



I wanted to introduce GradientCore, my open-source machine learning library written from scratch in C++.

GradientCore is my attempt at building a lightweight ML framework with a focus on performance and understanding how things work under the hood. It currently includes:

- Tensor operations with efficient memory management
- Autograd (automatic differentiation)
- Basic optimizers
- Neural network module

The project started because I personally struggle to think clearly when coding in Python. I wanted something built in C++ that I could actually understand and extend.

It began as a learning project inspired by Magicalbat’s “Coding a Machine Learning Library in C from Scratch” YouTube series. After a few failed attempts (including one very messy AI-assisted branch), I restarted clean and built it step by step.

The library is still early stage — nowhere near PyTorch level — but it’s becoming usable. All testing so far has been on my local machine, so feedback and bug reports are very welcome.


Links :-
github - https://github.com/spandan11106/GradCore-Tensor
docs - https://spandan11106.github.io/GradCore-Tensor/
blog - https://spandan11106.github.io/GradCore-Tensor/blog


I’m looking for contributors who are interested in C++ and machine learning. Even small contributions (bug fixes, documentation improvements, examples, etc.) would be greatly appreciated.

Would love to hear your thoughts or suggestions!

Thanks!

https://redd.it/1tlq21k
@r_cpp
GitHub GitHub - spandan11106/GradCore-Tensor: Machine Learning framework built from scratch in CPP. Machine Learning framework built from scratch in CPP. - spandan11106/GradCore-Tensor
More from @r_cpp
  1. Sep 29, 2026Boost.Graph 1.95 will be C++17 Dear Boost.Graph community, In two release cycles (Boost re…
  2. Sep 26, 2026Token Sequence Injection & Modern Macros: The Most Game-Changing Compile-Time Feature in C…
  3. Sep 25, 2026myStringStream.str("") Considered Harmful Under C++20 I was recently looking at some (rath…
  4. Sep 20, 2026A clever branch free optimization I'm the developer of memlz which is an extremely fast co…
  5. Sep 15, 2026Inside Boost.PolyCollection https://bannalia.blogspot.com/2026/09/inside-boostpolycollecti…
  6. Sep 11, 2026C++26: Standard Library Hardening Experiments https://www.cppstories.com/2026/hardening-ex…
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook →Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 →