Coding a Neural Network from Scratch in C: No Libraries Required

Поділитися
Вставка
  • Опубліковано 6 січ 2025

КОМЕНТАРІ • 69

  • @NicolaiAI
    @NicolaiAI  Рік тому +2

    Join My AI Career Program
    www.nicolai-nielsen.com/aicareer
    Enroll in My School and Technical Courses
    www.nicos-school.com

  • @inspacesilence
    @inspacesilence 11 місяців тому +16

    Doing ML things without any libraries and with C is a feeling.... like baby walking without the the help of walker or any support. Thanks for such a great thing

    • @NicolaiAI
      @NicolaiAI  11 місяців тому +3

      Thanks a lot! Haha yeah that’s so true

  • @joaquinsancaro6285
    @joaquinsancaro6285 2 роки тому +20

    Thank you so much for the video. It was my first time coding NN's, and everything was so clear and easy to follow!

    • @NicolaiAI
      @NicolaiAI  2 роки тому +1

      Thank u so much! Really appreciate it

  • @Leonhart_93
    @Leonhart_93 7 місяців тому +5

    Great idea, doing a project like this without any libraries basically guarantees I understand both C and ML, the perfect learning experience.

    • @NicolaiAI
      @NicolaiAI  7 місяців тому +2

      Thanks a lot! Totally agree

  • @vasilimacharadze139
    @vasilimacharadze139 2 роки тому +8

    great job man! finnaly something so minimal, simple and comprehencible. Without Bias arraies it gets even more cleaner.. and with the same result ;)

    • @NicolaiAI
      @NicolaiAI  2 роки тому +1

      Thanks a lot for watching!

  • @msodev
    @msodev 7 місяців тому

    Thanks a lot for the comprehensive code mate, I was able to re-implement this in Rust with almost no issues

  • @markr9640
    @markr9640 Рік тому +1

    Thanks very much for taking the time to make this video. I got your code working, and modified it to do any number of layers and any number of nodes. I could not have done it without your help. What really helped a lot was the fact that you found the simplest complex case - the XOR gate! An OR gate or AND gate would have been too simple, but XOR is just complex enough to see the AI doing its stuff. Bravo.

    • @NicolaiAI
      @NicolaiAI  Рік тому

      Thanks a lot for watching Mark! glad that it helped you out. Really appreciate ur kind words aswell. If u don’t mind sharing the general code with me. I would love to take a look at it and maybe do a video about it. My mail is thecodinglibraryyt@gmail.com just in case

  • @xfufly
    @xfufly 6 місяців тому +1

    Followed it in JavaScript, and it works !
    Thank you !

  • @shripadpotphode6319
    @shripadpotphode6319 9 місяців тому

    Can i use the this house prediction data purpose

  • @kamilkarwacki9590
    @kamilkarwacki9590 2 роки тому +10

    wow man, that is very cool. I have only come across this in python but not C. Keep it up!

  • @stefanbanev
    @stefanbanev 7 місяців тому

    at 44:45 error += deltaOutput[k] * outputWeights[j][k]; the errors individually can be huge but their sum can be == 0 because negative errors may compensate positive errors; so errors should be ABS(error) or error*error... Pls correct me if I'm wrong....

  • @martin_j_ward1871
    @martin_j_ward1871 Рік тому +1

    this video rocks, its a lot to take it at once i had to watch it in chunks but i'm excited to use it to build something for my portfolio!

    • @NicolaiAI
      @NicolaiAI  Рік тому

      Sounds awesome man! Thanks for watching

  • @skiskyscrystal
    @skiskyscrystal Рік тому +1

    Tysm Man i was searching for this for a long time you are the best! =)

    • @NicolaiAI
      @NicolaiAI  Рік тому

      Thanks for watching bro! Means a lot to me

  • @BadBakh
    @BadBakh 5 місяців тому +2

    Thank you so much for sharing such a knowledge

    • @NicolaiAI
      @NicolaiAI  5 місяців тому +1

      Thanks for watching!

    • @BadBakh
      @BadBakh 5 місяців тому

      @@NicolaiAI do you think there is way to make a gan with c ?

  • @romandavydov3888
    @romandavydov3888 2 роки тому +4

    That's cool. Maybe it makes sense to do a training course on the use of С in the world of finance.

    • @NicolaiAI
      @NicolaiAI  2 роки тому

      Thanks for the suggestion!

  • @sparklexscrewyachivements813

    Thanks, How Can Implant Levenberg-Marquardt algorithm in cpp? for nn

  • @ShopperPlug
    @ShopperPlug 2 роки тому +5

    Thanks, great to see implementation in good old "C". Can this also apply for convulsion networks?

    • @NicolaiAI
      @NicolaiAI  2 роки тому +2

      Thanks for watching! Yeah but cnn would be a bit more complex since we will add more dimensions

    • @ShopperPlug
      @ShopperPlug 2 роки тому

      @@NicolaiAI Interesting. Thank You again for this amazing tutorial done in C, super helpful to make and design AI fine tuned for different embedded NPU/GPU/CPU hardware. I have tried looking for books and online courses to do these task all in pure C and if not C++ and couldn't find any, however your channel have many tutorials into it.

    • @NicolaiAI
      @NicolaiAI  2 роки тому +1

      @@ShopperPlug thanks a lot for the nice words! Really appreciated it

  • @Leonhart_93
    @Leonhart_93 7 місяців тому +1

    Doing it without libraries at fist is how you are guaranteed to understand it.

  • @tomstevelt9641
    @tomstevelt9641 Рік тому +1

    Is this code still available on your github page? I don't see it.

    • @NicolaiAI
      @NicolaiAI  Рік тому

      Yeah should be in there somewhere

  • @samljer
    @samljer Рік тому

    letter for letter i copied this, it never finishes a training loop
    stack around variables corrupt. the variable changes.

    • @freemotion21
      @freemotion21 6 місяців тому

      Try removing the return 0; at the end and tell me if it work

  • @Faby__
    @Faby__ Рік тому +1

    nice video and very good explanation!

    • @NicolaiAI
      @NicolaiAI  Рік тому

      Glad you liked it! My pleasure

  • @gizembukulmez
    @gizembukulmez Рік тому

    Where is the dc link?

  • @kaowei-chien8843
    @kaowei-chien8843 Рік тому +2

    dSigmoid should be sigmoid(x) * (1 - sigmoid(x) ) not x * (1-x), am i wrong? i am so confused in this part

    • @NicolaiAI
      @NicolaiAI  Рік тому +2

      They are equivalent here since we take the sigmoid of the values in the hidden layer and output layer and then we pass those values into our dsigmoid. Ur formula is correct but we already have our sigmoid values in this example

  • @fustigate8933
    @fustigate8933 2 роки тому

    Don't really get the shuffle part, could you explain it in more detail?

  • @arandom5765
    @arandom5765 2 роки тому

    why not using the real Dsigmoid (replacing x by sigmoid(x)) ?

  • @mozarellachan5854
    @mozarellachan5854 Рік тому +1

    thank you. I can make my owned library for regression

  • @emomaxd
    @emomaxd 2 роки тому +1

    please make a new video like this that helped much and i learned how to code nn myself

    • @NicolaiAI
      @NicolaiAI  2 роки тому +1

      Thanks a lot man! Glad that u learned something from the video

  • @Anteater23
    @Anteater23 2 роки тому +1

    Is c++ similar?

    • @NicolaiAI
      @NicolaiAI  2 роки тому

      Yeah its almost the same in this case

  • @onurbaydas
    @onurbaydas 2 роки тому +1

    thank you so much.

    • @NicolaiAI
      @NicolaiAI  2 роки тому +1

      Thanks for watching!

  • @stefanbanev
    @stefanbanev 7 місяців тому +1

    Perfect!!!

  • @oglothenerd
    @oglothenerd Рік тому +2

    *me following with the rust programming language*

  • @fantasypvp
    @fantasypvp Рік тому +1

    watching this tutorial having never programmed in c before
    time to reimplement this all in rust XD (im trying to code an OS and i want to try implementing some cool features)

  • @tomstevelt9641
    @tomstevelt9641 Рік тому +1

    Mange tak!

  • @anusra3039
    @anusra3039 2 роки тому +2

    For(k) error

  • @pravachanpatra4012
    @pravachanpatra4012 Рік тому

    32:32

  • @انوارفارسخليل
    @انوارفارسخليل Рік тому

    👍