85

About six months ago I decided I wanted to learn to write a neural network from the ground up, using only the C++ standard lib. Had to learn some linear algebra, multivariable calc and a dash of wizardry.

The mathematics of neural networks is still one of the coolest things I've ever learnt. It still marvels me that you can make a specialized mini-brain out of nothing but numbers.

Comments
  • 11
    Hello, do you by any chance still have the source code for that? Could you share it?
  • 5
    . For notifs
  • 4
    Weeee, that's cool
  • 11
    If I had the free time, I would absolutely do this.
    I've wanted to write an AI for well over a decade, and wanted to learn the math behind ML since I heard of it.

    I am so envious of you right now.
  • 0
    It's cool but the maths is also really easy aye
  • 0
    @Gaveuxifort Maybe for some, certainly wasn't for me... 😅
  • 5
    @BadFox Check my github (on my profile) for the TexasHoldemNN project. Might be a bit sketchy, but under the nn src folder you'll find the neural network code. Docs are in the header files, not the neatest so it may be a bit hard to understand 😅

    For learning purposes, I'd recommend 3Blue1Brown on YouTube, he's got an awesome 4 part lesson on neural networks, and the fourth episode is a deep dive into the maths of it, with great visualizations.
  • 1
    @Root See my above comment :) it doesn't take that much, if you're familiar with differential calculus. And the series I mentioned is really good to help you conceptualize and understand how it works on all levels.
  • 4
    Years ago, when at university, a neural net module was being offered - and I rushed at the chance to take it.

    Sadly, although offered as part of a compsci degree, it basically existed as an entry to a computing MSc for psychology undergrads, and had no heavy maths or technical content in it at all. Instead, we spent wasted hours pouring over the "ethics" of neural nets, "philosophy" of neural nets, and ran a few simulations in some hideous pre-built tool that crashed every 2 seconds.

    I think that was the most wasted opportunity of a module I ever saw while at uni.
  • 3
    @nanoandrew4 The only calc I know is what I've taught myself. I don't think I'm there yet.
  • 1
    @AlmondSauce That's really heartbreaking :(
  • 3
    @Root No rush, you'll get there eventually. Regardless, the video series i mentioned is really easy to follow, if you want to just take a look :) there's no math until the last episode
  • 3
    @AlmondSauce ugh. "Ethics." Also known as opinions held by those uneducated in the field.
  • 1
    Are you have a open source of that to share with us?
  • 1
    @messhias Yeah, I mentioned it before but in case it got buried.

    On my devRant profile page, go to my GitHub and check the TexasHoldemNN project.

    Under the nn folder you'll find all the neural network code, docs are in the headers. Maybe not very pretty (I'm no pro with c++) but functional.
  • 1
    Nice, I'll take a look.
  • 0
    @Root there's our project
Add Comment