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

แชร์
ฝัง
  • เผยแพร่เมื่อ 21 ส.ค. 2024
  • 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-ni... (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-ni...
    _____________________________________________________________
    💻💰🛠️ High Earner AI Career Program: www.nicolai-ni...
    ⚙️ Real-world AI Technical Courses: (www.nicos-scho...)
    📗 OpenCV GPU in Python: www.nicos-scho...
    📕 YOLOv7 Object Detection: www.nicos-scho...
    📒 Transformer & Segmentation: www.nicos-scho...
    📙 YOLOv8 Object Tracking: www.nicos-scho...
    📘 Research Paper Implementation: www.nicos-scho...
    📔 CustomGPT: www.nicos-scho...
    _____________________________________________________________
    📞 Connect with Me:
    🌳 linktr.ee/nico...
    🌍 My Website: www.nicolai-ni...
    🤖 GitHub: github.com/nic...
    👉 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
  • วิทยาศาสตร์และเทคโนโลยี

ความคิดเห็น • 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 7 หลายเดือนก่อน +12

    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  7 หลายเดือนก่อน +3

      Thanks a lot! Haha yeah that’s so true

  • @Leonhart_93
    @Leonhart_93 3 หลายเดือนก่อน +4

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

    • @NicolaiAI
      @NicolaiAI  3 หลายเดือนก่อน +2

      Thanks a lot! Totally agree

  • @joaquinsancaro6285
    @joaquinsancaro6285 2 ปีที่แล้ว +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  2 ปีที่แล้ว +1

      Thank u so much! Really appreciate it

  • @kamilkarwacki9590
    @kamilkarwacki9590 2 ปีที่แล้ว +9

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

    • @NicolaiAI
      @NicolaiAI  2 ปีที่แล้ว +2

      Thanks a lot man!

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

  • @lesvaleursdetim5474
    @lesvaleursdetim5474 2 หลายเดือนก่อน +1

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

    • @NicolaiAI
      @NicolaiAI  2 หลายเดือนก่อน +1

      Great!

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

  • @BadBakh
    @BadBakh 29 วันที่ผ่านมา +2

    Thank you so much for sharing such a knowledge

    • @NicolaiAI
      @NicolaiAI  29 วันที่ผ่านมา +1

      Thanks for watching!

    • @BadBakh
      @BadBakh 29 วันที่ผ่านมา

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

  • @msodev
    @msodev 2 หลายเดือนก่อน

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

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

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

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

  • @stefanbanev
    @stefanbanev 3 หลายเดือนก่อน +1

    Perfect!!!

    • @NicolaiAI
      @NicolaiAI  3 หลายเดือนก่อน

      Thanks a lot!

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

  • @Faby__
    @Faby__ ปีที่แล้ว +1

    nice video and very good explanation!

    • @NicolaiAI
      @NicolaiAI  ปีที่แล้ว

      Glad you liked it! My pleasure

  • @stefanbanev
    @stefanbanev 3 หลายเดือนก่อน

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

  • @Leonhart_93
    @Leonhart_93 3 หลายเดือนก่อน +1

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

  • @oglothenerd
    @oglothenerd 8 หลายเดือนก่อน +2

    *me following with the rust programming language*

    • @NicolaiAI
      @NicolaiAI  8 หลายเดือนก่อน +1

      Awesome! Great idea

    • @oglothenerd
      @oglothenerd 8 หลายเดือนก่อน +1

      @@NicolaiAI :)

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

  • @mozarellachan5854
    @mozarellachan5854 8 หลายเดือนก่อน +1

    thank you. I can make my owned library for regression

    • @NicolaiAI
      @NicolaiAI  8 หลายเดือนก่อน

      Awesome man! Yeah def do that. Great learning

    • @mozarellachan5854
      @mozarellachan5854 8 หลายเดือนก่อน

      @@NicolaiAI yeah awesome, Man.

  • @onurbaydas
    @onurbaydas ปีที่แล้ว +1

    thank you so much.

    • @NicolaiAI
      @NicolaiAI  ปีที่แล้ว +1

      Thanks for watching!

  • @shripadpotphode6319
    @shripadpotphode6319 4 หลายเดือนก่อน

    Can i use the this house prediction data purpose

  • @fustigate8933
    @fustigate8933 2 ปีที่แล้ว

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

  • @tomstevelt9641
    @tomstevelt9641 ปีที่แล้ว +1

    Mange tak!

    • @NicolaiAI
      @NicolaiAI  ปีที่แล้ว

      Tak for kigget!

  • @arandom5765
    @arandom5765 ปีที่แล้ว

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

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

  • @anusra3039
    @anusra3039 ปีที่แล้ว +2

    For(k) error

  • @sparklexscrewyachivements813
    @sparklexscrewyachivements813 9 หลายเดือนก่อน

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

  • @samljer
    @samljer ปีที่แล้ว

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

    • @freemotion21
      @freemotion21 หลายเดือนก่อน

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

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

    • @NicolaiAI
      @NicolaiAI  ปีที่แล้ว

      Sounds very cool!

    • @freemotion21
      @freemotion21 หลายเดือนก่อน

      How's the OS project going?

  • @gizembukulmez
    @gizembukulmez 7 หลายเดือนก่อน

    Where is the dc link?

  • @user-sz7re4qb4k
    @user-sz7re4qb4k 10 หลายเดือนก่อน

    👍

  • @pravachanpatra4012
    @pravachanpatra4012 8 หลายเดือนก่อน

    32:32