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

Поділитися
Вставка
  • Опубліковано 19 чер 2022
  • Inside my school and program, I teach you my system to become an AI engineer or freelancer. Life-time access, personal help by me and I will show you exactly how I went from below average student to making $250/hr. Join the High Earner AI Career Program here 👉 www.nicolai-nielsen.com/aicareer (PRICES WILL INCREASE SOON)
    You will also get access to all the technical courses inside the program, also the ones I plan to make in the future! Check out the technical courses below 👇
    _____________________________________________________________
    In this video 📝 we are going to learn how to build a neural network from scratch in C. We will first go over the basic theory about neurons and neural networks with visualizations. We will then jump into C and build the neural network from scratch and train it.
    If you enjoyed this video, be sure to press the 👍 button so that I know what content you guys like to see.
    _____________________________________________________________
    🛠️ Freelance Work: www.nicolai-nielsen.com/nncode
    _____________________________________________________________
    💻💰🛠️ High Earner AI Career Program: www.nicolai-nielsen.com/aicareer
    ⚙️ Real-world AI Technical Courses: (www.nicos-school.com)
    📗 OpenCV GPU in Python: www.nicos-school.com/p/opencv...
    📕 YOLOv7 Object Detection: www.nicos-school.com/p/yolov7...
    📒 Transformer & Segmentation: www.nicos-school.com/p/transf...
    📙 YOLOv8 Object Tracking: www.nicos-school.com/p/yolov8...
    📘 Research Paper Implementation: www.nicos-school.com/p/resear...
    📔 CustomGPT: www.nicos-school.com/p/custom...
    _____________________________________________________________
    📞 Connect with Me:
    🌳 linktr.ee/nicolainielsen
    🌍 My Website: www.nicolai-nielsen.com/
    🤖 GitHub: github.com/niconielsen32
    👉 LinkedIn: / nicolaiai
    🐦 X/Twitter: / nielsencv_ai
    🌆 Instagram: / nicolaihoeirup
    _____________________________________________________________
    🎮 My Gear (Affiliate links):
    💻 Laptop: amzn.to/49LJkTW
    🖥️ Desktop PC:
    NVIDIA RTX 4090 24GB: amzn.to/3Uc7yAM
    Intel I9-14900K: amzn.to/3W4Z5Cb
    Motherboard: amzn.to/4aR6wBC
    32GB RAM: amzn.to/3Jt2XVR
    🖥️ Monitor: amzn.to/4aLP8hh
    🖱️ Mouse: amzn.to/3W501GH
    ⌨️ Keyboard: amzn.to/3xUGz5b
    🎙️ Microphone: amzn.to/3w1F1WK
    📷 Camera: amzn.to/4b4Ryr9
    _____________________________________________________________
    Tags:
    #NeuralNetwork #C #DeepLearning
  • Наука та технологія

КОМЕНТАРІ • 66

  • @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 6 місяців тому +10

    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  6 місяців тому +2

      Thanks a lot! Haha yeah that’s so true

  • @Leonhart_93
    @Leonhart_93 Місяць тому +3

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

    • @NicolaiAI
      @NicolaiAI  Місяць тому +2

      Thanks a lot! Totally agree

  • @joaquinsancaro6285
    @joaquinsancaro6285 Рік тому +19

    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  Рік тому +1

      Thank u so much! Really appreciate it

  • @lesvaleursdetim5474
    @lesvaleursdetim5474 Місяць тому +1

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

  • @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

  • @msodev
    @msodev Місяць тому

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

  • @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!

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

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

  • @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

  • @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

  • @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
    @sparklexscrewyachivements813 8 місяців тому

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

  • @stefanbanev
    @stefanbanev Місяць тому

    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....

  • @shripadpotphode6319
    @shripadpotphode6319 3 місяці тому

    Can i use the this house prediction data purpose

  • @stefanbanev
    @stefanbanev Місяць тому +1

    Perfect!!!

  • @ShopperPlug
    @ShopperPlug Рік тому +5

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

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

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

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

      @@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  Рік тому +1

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

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

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

  • @Leonhart_93
    @Leonhart_93 Місяць тому +1

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

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

    nice video and very good explanation!

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

      Glad you liked it! My pleasure

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

    thank you so much.

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

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

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

    Where is the dc link?

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

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

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

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

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

    *me following with the rust programming language*

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

      Awesome! Great idea

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

      @@NicolaiAI :)

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

    thank you. I can make my owned library for regression

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

      Awesome man! Yeah def do that. Great learning

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

      @@NicolaiAI yeah awesome, Man.

  • @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

  • @tomstevelt9641
    @tomstevelt9641 10 місяців тому +1

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

    • @NicolaiAI
      @NicolaiAI  10 місяців тому

      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 11 днів тому

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

  • @tomstevelt9641
    @tomstevelt9641 10 місяців тому +1

    Mange tak!

    • @NicolaiAI
      @NicolaiAI  10 місяців тому

      Tak for kigget!

  • @user-sz7re4qb4k
    @user-sz7re4qb4k 8 місяців тому

    👍

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

    Is c++ similar?

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

      Yeah its almost the same in this case

  • @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)

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

    For(k) error

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

    32:32