Learn Neural Networks through coding

Sdílet
Vložit
  • čas přidán 28. 08. 2024

Komentáře • 153

  • @dukegard2504
    @dukegard2504 Před 2 lety +13

    You're a great instructor. Looking forward to more advanced topics, as you mentioned.

    • @Radu
      @Radu  Před 2 lety +1

      Thank you. I'll try to come up with something in the future!

  • @christague2084
    @christague2084 Před 11 měsíci +4

    Seeing my car accidentally avoid the car in front of it was super cool! Love this series!

    • @Radu
      @Radu  Před 11 měsíci

      Glad you enjoy it! :-)

  • @apidas
    @apidas Před rokem +8

    I really want you to teach more about the math, you're such a good explainer.

    • @Radu
      @Radu  Před rokem +1

      I will try to make time for it. Thanks for watching :-)

  • @ScriptRaccoon
    @ScriptRaccoon Před 2 lety +5

    Great video!
    Since you asked for further suggestions ;)
    1) In the feedForward method in the Level class, we can refactor various things: a) The first for-loop may be simply replaced by level.inputs = givenInputs. b) The nested for-loop, where the sum is computed, can be replaced by using the array method "reduce". c) The if-clause can be replaced by a ternary operator.
    2) In the feedForward method in the NeuralNetwork class, we can get rid of the code duplication as follows: Initialize ouputs = givenInputs. Then start the for-loop with index i=0.

    • @Radu
      @Radu  Před 2 lety +1

      Thanks :-)
      For 1 a), I don't remember why I did that. It could be something not obvious at this stage... maybe we need a deep copy later when parallelizing and visualizing things. But now I can already imagine you saying level.inputs = [... givenInputs] :-))
      All others are nice ideas as well, especially since I don't use "reduce" at all during this course. Will keep them in mind for future courses.

    • @johnsonogbu8697
      @johnsonogbu8697 Před rokem

      @@Radu
      Bro, I'm stuck.
      I need your help.

  • @Radu
    @Radu  Před 2 lety +1

    Full self-driving car course playlist (3 lectures still to come on visualization, optimization and fine-tuning):
    czcams.com/play/PLB0Tybl0UNfYoJE7ZwsBQoDIG4YN9ptyY.html

  • @kinsukaweerasooriya2933
    @kinsukaweerasooriya2933 Před 2 měsíci +1

    2:43 this backdown is 🔥

    • @Radu
      @Radu  Před 2 měsíci +1

      :-) glad you liked it

  • @coachtroop
    @coachtroop Před 2 lety +10

    This is fun! I looking forward to the next one! 😀

    • @Radu
      @Radu  Před 2 lety +4

      Thanks for watching :-)
      Next one is on visualizing the network. And one after that is when we get it to do something smart.

    • @coachtroop
      @coachtroop Před 2 lety +4

      @@Radu It's all been smart 😀 Don't sell yourself short. You're tackling a problem I typically am not exposed to, so it's been fun to think about how I would do it and compare to your work. I also don't know much about building NNets, and your explanation was fantastic and easy to follow. Thank you for that :)

    • @Radu
      @Radu  Před 2 lety +2

      @@coachtroop I'm really happy you find value in this :-) Thanks for the uplifting comment!

  • @TheNarckoz
    @TheNarckoz Před 2 lety +2

    Radu, merci pentru munca care o faci, invat multe lucruri noi de la tine!

    • @Radu
      @Radu  Před 2 lety

      Ma bucur!

  • @josephsam2145
    @josephsam2145 Před 4 měsíci +2

    Thank you sincerely for the informative video.
    My car is now doing doughnuts 😂.
    I'm excited for the next lesson.

    • @Radu
      @Radu  Před 4 měsíci

      Cool :-D

  • @aitorplaza2560
    @aitorplaza2560 Před 2 lety +8

    Awesome as always Radu.
    Just one question (so far). This code is like that (in this specific order) because you have decided it, right?
    if (this.useBrain){
    this.controls.forward=outputs[0];
    this.controls.left=outputs[1];
    this.controls.right=outputs[2];
    this.controls.reverse=outputs[3];
    }
    I mean, the order can be different and the neural network will 'adjust' to it, right?

    • @Radu
      @Radu  Před 2 lety +2

      Exactly. Won't matter at all in the end!

  • @jonatanandvanie7493
    @jonatanandvanie7493 Před 2 lety +2

    Thanks a lot for making this video. I probably understand only half of it, but it's very interesting. Please make more contents like this.

    • @Radu
      @Radu  Před 2 lety

      Thank you :-) and thanks for watching!

  • @ernststavrosblofeld366
    @ernststavrosblofeld366 Před 2 lety +3

    You are a gem radu.

    • @Radu
      @Radu  Před 2 lety +2

      Glad you like the content :-)

  • @swoopertr
    @swoopertr Před rokem +1

    simpliest way to show. He is legend.

    • @Radu
      @Radu  Před rokem

      Glad it was helpful!

  • @capitancodigo2165
    @capitancodigo2165 Před rokem +5

    without the "jingle" at the beginning learning would have been a whole different experience.

  • @serveshchaturvedi2034
    @serveshchaturvedi2034 Před rokem +2

    Hi Radu, this was an incredible video and I'm really grateful for it. The best part was the visualisation aling with the code. Just a small suggestion, the graphs and animation (particularly line slope animation) could have been a bit bigger. Hope to see more advanced content :)

    • @Radu
      @Radu  Před rokem +2

      Thanks for the tip. I'll try to keep it in mind :-)

  • @KT-ut9zg
    @KT-ut9zg Před rokem +1

    Well, I accidentally joined this course at Level 6 XD But... I was able to code along with it. So thanks, that shows how good your teaching technique is!! On to the visualiser...

    • @Radu
      @Radu  Před rokem

      Wow, good job :-)
      Hope you like the rest!

  • @Viezieg
    @Viezieg Před rokem +1

    best tutorial for coding neural networks. thank you so much !

    • @Radu
      @Radu  Před rokem

      You are welcome! :-)

  • @epshga
    @epshga Před 10 měsíci +1

    bro you're literally saving my life

    • @Radu
      @Radu  Před 10 měsíci

      How so? :-)

  • @akmalraj121
    @akmalraj121 Před 2 lety +1

    Brother You really deserved a lot more and more subscribers and attention !! Your videos are really best !!!!!!!!!

    • @Radu
      @Radu  Před 2 lety

      Thanks :-)

  • @flebedev9974
    @flebedev9974 Před 4 měsíci +1

    Truly amazing visualisations, Thanks!

    • @Radu
      @Radu  Před 4 měsíci

      You're welcome :-)

  • @alexwolfe4748
    @alexwolfe4748 Před rokem +1

    It took me a long time before I could understand why he was able to code such interesting projects. This guy is a genius, and has great passion for his subjects, as well as a great humor. Thank you so much for the content.

    • @Radu
      @Radu  Před rokem +1

      Thanks for the nice comment, but I'm not a genius :-) I've just spent a lot of time practicing.

    • @alexwolfe4748
      @alexwolfe4748 Před rokem +1

      @@Radu You are very humble but my first job was definitely from doing your tutorials. I got a job offer for 50k starting. It was after this I completed this video (I put in a good year of programming too).

    • @Radu
      @Radu  Před 11 měsíci

      Oh, wow, congrats :-)
      Phase 2 is coming out today, btw ;-)

  • @randomyoutubechannel4794
    @randomyoutubechannel4794 Před 2 lety +3

    Daaamn. Nice Explanation!

    • @Radu
      @Radu  Před 2 lety

      Thank you! :-)

  • @kalle4526
    @kalle4526 Před 2 lety +3

    Absolutely great vid! Looking forward for more content like that ☺️

    • @Radu
      @Radu  Před 2 lety

      Thanks! :-) I'll try to make more like this in the future.

  • @laharisengupta
    @laharisengupta Před rokem +1

    Great explanation of neural network with so much clarity

    • @Radu
      @Radu  Před rokem +1

      Glad you liked it :-)

  • @aliensoul7600
    @aliensoul7600 Před rokem +1

    Thank you sir for opening my third eye... 😱

    • @Radu
      @Radu  Před rokem

      My pleasure! :-)

  • @2difficult2do
    @2difficult2do Před 7 měsíci

    Good explanation of basic concepts 👍👍👍. It's interesting topic. Thanks.

    • @Radu
      @Radu  Před 7 měsíci +1

      Thank you :-)

  • @AbhinavSrivastava11
    @AbhinavSrivastava11 Před 2 lety +2

    Really Awesome Dude 👍

    • @Radu
      @Radu  Před 2 lety +1

      Thanks :-)

  • @JackySupit
    @JackySupit Před rokem +1

    Thank you much Mr Radu. It's so entertaining but more important, it's so useful the lessons you teach us here. I immediately subscribe after watching this video. Anyway Mr Radu, at 21:31 Can we teach the car / the brain to randomly move slight right or left when we meet a condition like that.
    I am trying to teach the car's brain but unfortunately, even my own brain do not understand yet about any of these :")

    • @Radu
      @Radu  Před rokem

      Sure, it's explained in an upcoming lecture, after the visualizing part.

  • @aliph-null
    @aliph-null Před 2 lety +2

    Radu, good tutorial, keep up the good work, also eng and ro?

    • @Radu
      @Radu  Před 2 lety +1

      Thanks! I'll try :-) but I'll stick to English language, otherwise I alienate 99.2% of my viewers :-)

    • @aliph-null
      @aliph-null Před 2 lety +1

      @@Radu nice

  • @surafelamsalu5259
    @surafelamsalu5259 Před 7 měsíci +1

    They are really incredible, but are you thinking of making it using Python? Please.

    • @Radu
      @Radu  Před 7 měsíci

      At work I teach it using Python, but I don't plan to make videos about it. I like keeping one main language on the channel.

  • @alexloukum7673
    @alexloukum7673 Před 2 lety +1

    HUGE and mad production thx man

    • @Radu
      @Radu  Před 2 lety

      No problem :-) Glad you liked it!

  • @sharmarahul384
    @sharmarahul384 Před 2 lety +2

    Hi, I learned and enjoyed a lot in this series.
    One question. Why is 6 used in middle level. What will happen if I use a bigger or small number in place of 6 there?

    • @Radu
      @Radu  Před 2 lety +2

      It's an arbitrary number :-)
      The system supports if you remove that layer entirely [inputs, outputs], or if you add few more hidden layers, like [inputs, 6, 5, 4, outputs]. The number of the neurons on each layer is related to how difficult the task is, more complicated tasks will require more complexity (like brains of different animals enable them to do less or more intelligent things) but they are also more difficult to train (like human brains take years to develop while some species know what to do days or even hours after being born). Our algorithm for optimizing the network (2 videos after this one) is not very sophisticated, so, training a large network will take quite a long time.

    • @sharmarahul384
      @sharmarahul384 Před 2 lety +1

      @@Radu Thanks

    • @Radu
      @Radu  Před 2 lety +1

      @@sharmarahul384 No problem :-)

  • @alexandreknihar3279
    @alexandreknihar3279 Před 2 lety +1

    This is so well made! Keep it up :)

    • @Radu
      @Radu  Před 2 lety

      Thank you! And thanks for watching :-)

  • @raymondmichael4987
    @raymondmichael4987 Před 2 lety +1

    Please consider tensorflow

    • @Radu
      @Radu  Před 2 lety +1

      It's a good library.

  • @morezco
    @morezco Před 2 lety +1

    Awesome. I will be doing this today 🙂

    • @Radu
      @Radu  Před 2 lety +1

      Cool! Good luck :-)

    • @morezco
      @morezco Před 2 lety +1

      @@Radu We did it, my girlfriend and I. We really enjoyed it! I will be doing the whole series now, she will be doing some reading to get into ML
      Great stuff man, we’re subbed 😄

    • @Radu
      @Radu  Před 2 lety +1

      @@morezco Awesome :-)

  • @WhuTom1
    @WhuTom1 Před 7 měsíci +1

    Thank you for your amazing video - I am having an error in my code at 18:29 in the video, when you define outputs and link the neural network to car.js. This is the error: network.js:61 Uncaught TypeError: Cannot read properties of undefined (reading 'inputs') - in my code this is pointing to the initial for loop in the feedForward method of the Level class. Do you know where the issue might be? Thanks

    • @Radu
      @Radu  Před 7 měsíci

      It's a little hard to say without seeing your code. If you share it somehow (like on my Discord), I can have a look.

  • @med1071
    @med1071 Před rokem +1

    Hello, great video :D, but I didn't quite understand the reason behind choosing this amount of neurons in the hidden layer. What is the impact for adding more or fewer layer/neuron ? Why bother adding a hidden layer in the first place ? And if more layers/neurons is better (I imagine this is the case), why not add 10 layers with 8 neurons each for example (or make 1 "super layer" with 80 neurons in it, or make 40 layers with 2 neurons each to reduce the amount of connections per layer) ?

    • @Radu
      @Radu  Před rokem

      In short, more layers / neurons means a more complex network, meaning that it can do more things... Here, I don't think the hidden layer is necessary to accomplish what is needed, I just showed it because I wanted to show that the code is general and can work with many layers and different neuron counts.
      Larger networks can be more powerful, but finding optimum weights and biases is also more difficult. Our way of training here (trial and error, pretty much) is not fantastic, so, a complex network may perform worse than a simple one.
      I will make a part 2 and 3 to this course in the future. In part 2 I will design more complicated scenarios and in part 3 we will learn more about neural networks. So, stay tuned :-)

    • @med1071
      @med1071 Před rokem +1

      @@Radu Thanks for the explanation !

    • @Radu
      @Radu  Před 11 měsíci

      No problem. Btw, phase 2 is coming out later today. Phase 3 probably in January.

  • @SeraphicFrost
    @SeraphicFrost Před 4 měsíci +1

    how line slope animation is related to y = mx + c in our case and how should i visualize it to understand?

    • @Radu
      @Radu  Před 4 měsíci

      I recommend you watch phase 3 of the course. The 'Understanding AI' playlist on the channel. The first few lessons there talk about the math behind neural networks. And you can watch that now with no problem. It doesn't depend on phase 2 of the course.

    • @SeraphicFrost
      @SeraphicFrost Před 4 měsíci +1

      @@Radu sure will do that, well i want to master machine learning, and have no idea how to do that where to learn what to learn. I m thinking of completing self driving car and then ur machine learning course and leaning some maths from 3b1b.
      is that right approach for now as a beginner who knows how to make simple 2d stuff in directx using c++

    • @Radu
      @Radu  Před 4 měsíci +1

      @SeraphicFrost if you want to understand how things work, that sounds like a good plan. But keep in mind that once you know what you're doing, switching to python gives you access to a lot of advanced methods, already implemented in various libraries.

  • @marcyanus1430
    @marcyanus1430 Před 2 lety +1

    What are you using for the explanatory animations?

    • @Radu
      @Radu  Před 2 lety +2

      Hi Marc! I'm coding them with the same techniques I used to make the neural network visualizer (my next video in the series). I render them on a green canvas, record the screen and then crop it and remove make the green parts transparent in editing.

  • @champx549
    @champx549 Před rokem +1

    hey buddy! could you make a tutorial on backpropagation as well?

    • @Radu
      @Radu  Před rokem +1

      Someday, if I figure out how to teach it differently than others do.

    • @champx549
      @champx549 Před rokem +1

      @@Radu i have gotten into neural networks with the help of your self-driving car course

    • @champx549
      @champx549 Před rokem +1

      @@Radu i was trying to find a nice tutorial on it but just couldn't find one so i figured i would ask the man himself!

    • @Radu
      @Radu  Před rokem

      @@champx549 as I mentioned in the video, 3b1b has a really good one.

    • @Radu
      @Radu  Před rokem

      @@champx549 nice :-)

  • @andrewbrown8992
    @andrewbrown8992 Před 2 lety +1

    Under certain conditions my sensors will be yellow through the body of the traffic car. Any debugging tips?

    • @andrewbrown8992
      @andrewbrown8992 Před 2 lety +1

      ^ when the ray length is beyond the size of the traffic car

    • @Radu
      @Radu  Před 2 lety

      Hmmm put a breakpoint when the sensor reads something and try to reproduce and see if all the touches are detected. You can also share your code if you want.

    • @andrewbrown8992
      @andrewbrown8992 Před 2 lety +1

      @@Radu I have sent some things in the discord! Thank you for this amazing series and any help you could provide!! :)

  • @ertemeren
    @ertemeren Před 4 měsíci +1

    I think that there is no seft-learning stage for this system am I right?

    • @Radu
      @Radu  Před 4 měsíci +1

      I assume you mean 'self-learning'?
      If by that, you mean that an agent doesn't learn anything, you are right... Once it gets assigned a brain it is 'fixed' and never changes throughout it's 'lifetime'. But the entire system is evolving or... learning what to do because the best of each generation is kept and mutated upon. So... it depends on the viewpoint.

    • @ertemeren
      @ertemeren Před 4 měsíci +1

      @@Radu Is it possible to extend project like saving data for keep it evolving on this? by the way being a new commer on this topic can be confusing

    • @Radu
      @Radu  Před 4 měsíci +1

      @@ertemeren I think I do teach how to store the brain in localStorage and continue to evolve on top of it... I also have phase 3 of the course now (Understanding AI playlist). It explains the math of neural networks much better than here and you can jump into it right away.

  • @adarshyadav5932
    @adarshyadav5932 Před 9 měsíci +1

    why static methods ?? why not normal methods?
    i know that static methods belongs to class and not to the individual object. but how does that logic applies here?
    and sir, What do you mean by 6:45 "i want to serialize this object afterwards"?

    • @Radu
      @Radu  Před 9 měsíci

      You answered your own question, kind of :-)
      Serializing means I want to store later the brain so it 'survives' refreshing the page. If you do that, it only stores the object attributes (like the weights, biases, in this case). Not the methods (like the feedforward algorithm). I use static methods because they are part of the class (we don't serialize that), not the objects (which we serialize). Hope this helps.

    • @adarshyadav5932
      @adarshyadav5932 Před 9 měsíci +1

      @Radu yeah!, It does help!
      But I got the answer later in the video itself😂
      I asked the question before watching the complete video!
      Sorry!🙇‍♂️

    • @Radu
      @Radu  Před 9 měsíci

      Ok. I forgot all I said in the video :-D

  • @zedzulzur
    @zedzulzur Před 2 lety

    Good job at explaining a very complex subject in a digestible byte.
    The only stopping point for me is when I connect the NeuralNetwork to the car, the browser tab spins until it crashes. I commented out the code where we are adding the Levels in the NeuralNetwork constructor then then project loads up fine.
    It’s late now gonna give my neurons a break. Anything you can think of that I a, doing wrong?

    • @Radu
      @Radu  Před 2 lety +1

      Can't really say from just reading your comment. Maybe you share the code with me somehow? I have a discord link on my channel banner, for example.

    • @zedzulzur
      @zedzulzur Před 2 lety

      I overwrote my network.js file with yours and it’s working now. I will compare later to see what caused that issue

    • @Radu
      @Radu  Před 2 lety

      @@zedzulzur ok :-)

  • @opritaoctav7180
    @opritaoctav7180 Před 2 lety +1

    La multi ani!

    • @Radu
      @Radu  Před 2 lety

      Merci :-) de unde știi?

  • @davidalex684
    @davidalex684 Před 5 měsíci +2

    Bro this is nice, neural network program.pls is this Vs code

    • @Radu
      @Radu  Před 5 měsíci +1

      Yes, it's VS Code.

    • @davidalex684
      @davidalex684 Před 5 měsíci +2

      @@Radu Thanks

    • @Radu
      @Radu  Před 4 měsíci +1

      No problem.

    • @davidalex684
      @davidalex684 Před 4 měsíci +1

      @@Radu although, its hard to install Python in Vscode.its just downloads and stops

    • @Radu
      @Radu  Před 4 měsíci +1

      Well, this code is not python...

  • @MrReneul
    @MrReneul Před 2 lety +1

    Nu te-o contactat inca Elon sa-i dai codu la self drive car?

    • @Radu
      @Radu  Před 2 lety

      Nu :-( ... dar e pe github... Cred ca l-a luat singur :-)

    • @remus1667
      @remus1667 Před 2 lety +1

      Elon e ocupat cu Twitter acum.😂😂😂

    • @Radu
      @Radu  Před 2 lety

      @@remus1667 sigur. Hmmm... prevad un self-tweeting car in the near future.

    • @remus1667
      @remus1667 Před 2 lety +1

      @@Radu Asta mai lipseste sa ma faca de rusine masina mea pentru ca is in urma cu Service-ul😂😂😂😂

    • @Radu
      @Radu  Před 2 lety

      @@remus1667 haha! Good one :-)

  • @unknown-bx8my
    @unknown-bx8my Před 2 lety +1

    🔥🔥🔥🔥🔥🔥🔥🔥🔥

  • @its_code
    @its_code Před rokem

    ❤❤❤❤😊

  • @yaverjavid
    @yaverjavid Před 2 lety +1

    Yo!

  • @rmsv
    @rmsv Před rokem +1

    You should read a little more neurobiology, because your idea of what a real neuron is is oversimplified.

    • @Radu
      @Radu  Před rokem

      Interesting. What would you add to this explanation?

    • @rmsv
      @rmsv Před rokem +1

      ​@@Radu Thank you for your answer. I'm a neurophysiologist (i.e. I study the 'mechanics' of the nervous system), and when I heard at 01:18 that "a single neuron does something really simple", especially after such a naive and over simplistic description of what a neuron is/does, it made me startle. I don't think you ask the right question. It's not what I would add to this explanation that's important, because there would be thousands of pages to add in order to give a more accurate description of what a neuron is and does, and that would be out-of-scope here. I would rather subtract the part pretending a real neuron does something simple because this is just not true. I am going to give you a few informative examples, but that will be just examples to prove my point and definitely not suggestions about what to add to your video. You said there were "branch-like structures that received the signals", i.e. dendrites. First dendrites are not only "receivers", they can also be "senders" (see dendritic release), even though this phenomenon is not well-known. Dendrites will not just receive signals, they will modulate their receptors, grow, "ungrow", produce variable delays, produce combinatorial computations based on branches (akin to logic gates or mathematical functions), transmit "reconfiguration signals" to the neuron nucleus so that the neuron behaves differently (modulating output, producing spontaneous rhythms, etc.), produce oscillations, etc., the list is long. This means there will be very complex computations happening there, that go way beyond a mere summation of inputs. Again, I'm not saying such a video should be an introduction to neurobiology, I'm merely saying, one should be careful pretending a neuron is something simple without first having a serious read about it. On a different note, I think your videos are cool and will probably help beginners understanding how to create a simulation and implement some AI algorithms along the way.

    • @Radu
      @Radu  Před rokem

      @@rmsv Ok. I can see why you were startled by this :-) My goal was to simplify and make the concepts more approachable. Definitely not to give a lesson in biology / physiology (I said I explain it as good as I can = high-school level). I do know a few more things than that... but they are not very relevant to artificial neural lessons so, I left them out. I know that some species have fewer, but more complex neurons than others making them more intelligent than others. This sounds a bit like your explanation of the dendrites above. But if dendrites really do complex computations like that then they can be modeled as smaller neural networks as well :-))

    • @rmsv
      @rmsv Před rokem +1

      ​@@Radu No, because the computations of dendrites are mainly analogue, not digital.

    • @Radu
      @Radu  Před rokem

      @@rmsv @Veritasium has a good video from about a year ago about analog computing explaining how they may make a comeback and how they can be used to implement neural networks.

  • @shivamdubey4783
    @shivamdubey4783 Před rokem +1

    what is leve1.#randomize(this); how this basically works

    • @Radu
      @Radu  Před rokem

      It is Level.#randomize, not leve1.#randomize.
      It is calling the private static method #randomize from the Level class.

    • @shivamdubey4783
      @shivamdubey4783 Před rokem +1

      @@Radu sir can you jus share the video or tell what it do coz i am seeing this first time in javascript that would be really helpul thankyou you are great teacher

    • @Radu
      @Radu  Před rokem

      @@shivamdubey4783 It's a method that belongs to the class itself, not to the object you instantiate from it. I use it because at some point, later, I serialize the neural network, and traditional methods don't serialize. Static ones don't either... but they remain available as such.

    • @shivamdubey4783
      @shivamdubey4783 Před rokem +1

      @@Radu thankyou so much sir totally understood you are a great teacher