Self-driving car - No libraries - JavaScript course [Final Lecture]

  Рет қаралды 12,366

Radu Mariescu-Istodor

2 жыл бұрын

⭐️COURSE INTRODUCTION⭐️
Hi and welcome to the self-driving car (no libraries) JavaScript course.
You will learn to make a self-driving car simulation by implementing every component one by one. I will teach you how to implement the car driving mechanics, how to define the environment, how to simulate some sensors, how to detect collisions and how to make the car control itself using a neural network.
I will explain how artificial neural networks work, by comparing them with the real neural networks in our brain. I will teach you how to implement a neural network and how to visualize it so we can see it in action. You will also learn some optimization techniques to make our car smarter.
The entire system is quite complex, however, each component is relatively easy in and of itself. I made this course keeping in mind my high-school days back in Romania. So, the knowledge you get from school could be enough to follow along (depending on the curriculum).
We use JavaScript to implement this system and I will teach modern JavaScript techniques during this course, so, this course is perfect no matter if you want to become a software engineer or a machine learning specialist (like me - I have over 10 years research experience with machine learning).
⭐️LECTURE 9: FINE-TUNING⭐️
We learn to draw a car using advanced powerpoint techniques. We then include the car image into our self-driving car project and learn to customize it by changing its color using JavaScript and globalcompositeoperations.
⭐️MORE COURSES⭐️
LAMAD: kzbin.info/aero/PLB0Tybl0UNfY1wfdwb8tlLBEz6H41P3aG
VWD: kzbin.info/aero/PLB0Tybl0UNfb3hTHPfEIg1SPw_-Ca9iIw
PUZZLE-CAM: kzbin.info/aero/PLB0Tybl0UNfadlXE6BSpPk6O1Rbfm9ITo
⭐️CODE⭐️
Github: github.com/gniziemazity/Self-driving-car (9. Fine-tuning)
Use '8. Optimization' if you plan to follow along!
My website: radufromfinland.com
⭐️ TABLE OF CONTENT ️⭐️
0:00 Intro
1:00 Drawing a car in PowerPoint
9:13 Drawing an image on HTML5 Canvas
11:29 Changing color of image in JavaScript
17:00 Get random color in JavaScript
18:45 Final words

Пікірлер: 183
@Radu
@Radu 2 жыл бұрын
Congratulations for those who got this far :-) What are your thoughts?
@miniontoby
@miniontoby Жыл бұрын
This is pretty cool and I finally got an AI, I wanted to make this far too long and you made it possible! Please make the video where you make the AI smarter, I would love to see stuff like that. (if you havent done that yet...)
@LordSluggo
@LordSluggo Жыл бұрын
This is really, really good. I'm studying for a Master's in mathematics and am doing my thesis on autonomous vehicles. I'd love to see more of this, maybe going into more techinical stuff like TensorFlow. You also did an amazing job explaining neural networks and I'd love to see more neural network and machine learning stuff.
@jonatanandvanie7493
@jonatanandvanie7493 Жыл бұрын
I like the course. I don't like drawing though haha But please teach us how to make the car respect the lane, and also make it smarter and drive like human. And after all of the 'no library' stuff, maybe make a comparison what if we build it with library, so we can understand more. Thanks a lot for all the teachings. May we all be smarter :)
@kevadiyasmart
@kevadiyasmart Жыл бұрын
can you make series on a full fledged self driving car with 3d simulation using three.js and this kind of neural network?
@Radu
@Radu Жыл бұрын
@@kevadiyasmart I will probably extend this course somehow in the autumn, but I don't think I'll make it 3D. It's not very difficult, but it's not the direction I want to take this. Some people online did change my code and made it 3D, though. If you're curious, I can try to find their work.
@JanderSilva01
@JanderSilva01 2 ай бұрын
For me, this is the best programming course to learn how to create things from scratch, please don't stop with this series.
@Radu
@Radu 2 ай бұрын
Thank you :-) It has evolved in a ... monster of a series (Phase 2 is already out and now Phase 3 is ongoing).
@volodyslove
@volodyslove 3 ай бұрын
the best course on youtube, thank you, i've learnt a lot! 😁
@Radu
@Radu 3 ай бұрын
Thanks! There's a Phase 2 as well (currently working on Phase 3).
@coachtroop
@coachtroop 2 жыл бұрын
Thank you for the final part. You inspired me to take a deeper dive into ML and neural networks, and computer vision, and I have been busy learning. Your approach here has been wonderful and I look forward to whatever you produce. Thank you so much for taking the time to make these.
@Radu
@Radu 2 жыл бұрын
Wow, nice to hear that I got you interested in the field! Good luck studying and thanks for watching :-)
@aliph-null
@aliph-null 2 жыл бұрын
Also, yes, please continue the AI series
@Radu
@Radu 2 жыл бұрын
Ok. I'm considering it, but probably in the autumn. Now I'm on holiday mood already :-)
@aliph-null
@aliph-null 2 жыл бұрын
@@Radu Understandable, your courses/lessons are enough to start on a basic level for a summer project. :)
@Radu
@Radu 2 жыл бұрын
@@aliph-null :-) Cool! I will still publish during summer, but no energy for intense things like this. If I do more AI, I want to do it justice... Not very advanced things, but to explain things well it takes effort. There are so many libraries you can try out nowadays and you can do remarkable things with just few lines of code, but when they don't work as expected, people often have no idea why.
@laurensdev
@laurensdev Жыл бұрын
How on earth do you not have 10 million subscribers because this content is really amazing!
@Radu
@Radu Жыл бұрын
You may have stumbled upon one of the biggest mysteries in the universe :-| Thanks, glad you liked it :-)
@official1tesla327
@official1tesla327 Жыл бұрын
Yes ofcourse!!! We would love a new course Radu
@Radu
@Radu Жыл бұрын
On its way :-)
@andresgardiol8111
@andresgardiol8111 Жыл бұрын
Please, do another course about this! This is by far one of the best courses of basics ML. I would like to take a deeper dive into the network part of this course.
@Radu
@Radu Жыл бұрын
Thank you :-) I am quite sure I will continue this in some shape or form.
@diegocassinera
@diegocassinera Жыл бұрын
How about backwards propagation on the existing net.
@Radu
@Radu Жыл бұрын
@@diegocassinera Problem is I don't know how to do that :-( For backpropagation I need to know if a move was good or bad and there can be multiple good / bad moves at each frame, pretty much...
@diegocassinera
@diegocassinera Жыл бұрын
@@Radu, Correct you will need data to train, in this case its not that hard to create. A vector for the inputs, plus a vector expected outputs. for example [5,5,5,5,5] (all forward sensors show something close, answer [0,0,0,1] go backwards, where [5,1,0,0,0] answers [1,0,1,0] forward right, and so on. In a few passes of forward backwards propagation should get a better network than going random. The reason I suggest this is because you are great teacher and you could adapt/re-user the network code, visualizer to solve the same or other problems in a different way using the same network.
@Radu
@Radu 7 ай бұрын
I'm probably going to do something like this in Phase 3 (January)
@official1tesla327
@official1tesla327 Жыл бұрын
Ohh my gosh , Radu, I deeeeeply love this course. Thanks alot ❤❤
@Radu
@Radu Жыл бұрын
Happy to hear!
@javifontalva7752
@javifontalva7752 5 ай бұрын
19:50 heck yes!!! I'd love a course like that.
@Radu
@Radu 5 ай бұрын
It's in the works :-)
@Viezieg
@Viezieg Жыл бұрын
Please make another tutorial on neural networks ! This one is the best !
@Radu
@Radu Жыл бұрын
I will, eventually. Thanks for watching :-)
@ruivalim3374
@ruivalim3374 2 жыл бұрын
Thank you so much Radu, I loved your course man, it was so good, keep it going, I would love to see more courses for you!
@Radu
@Radu 2 жыл бұрын
Thanks :-) I'll try my best!
@danisob3633
@danisob3633 Жыл бұрын
Thanks for this course. I loved it
@Radu
@Radu Жыл бұрын
No problem!
@Cenn_Devel
@Cenn_Devel Жыл бұрын
It's amazing how you find an answer for every comment you find, unlike other KZbinrs, who just put a heart on the comments, then they go.
@Radu
@Radu Жыл бұрын
It's not that hard for me... but for bigger channels it must be close to impossible. I mean... say I spend 1h replying to comments each week. If my channel would be 10 times larger, that means ~ 2 days of work... 100 times larger and there's not enough time to do it if that's the only thing you do :-)
@angladephil
@angladephil 2 жыл бұрын
Thx for all the good and interesting job ! The self-parking car is certainly a very interesting subject !
@Radu
@Radu 2 жыл бұрын
Alright :-) Good to know!
@niikurasu2855
@niikurasu2855 Жыл бұрын
Thank you so much for the course. Im gonna add infinite traffic and make the genetic algorithm pick new cars itself.
@Radu
@Radu Жыл бұрын
Good luck!
@elitecoldsteel
@elitecoldsteel 2 жыл бұрын
Truly awesome, I loved this course!!
@Radu
@Radu 2 жыл бұрын
Glad you enjoyed it! :-)
@santiagosalazar4694
@santiagosalazar4694 Жыл бұрын
Muchas gracias por este curso, estuvo excelente. Thanks you Radu!!
@Radu
@Radu Жыл бұрын
You're welcome :-)
@lucashang394
@lucashang394 10 ай бұрын
Amazing man, thanks for the great content. I'm very excited for the next courses about Neural Networks.
@Radu
@Radu 10 ай бұрын
Phase 2 will begin in September. It teaches how to make the environment more complex. Then Phase 3 will be about making the car drive itself in a more complex scenario.
@nickpawsey
@nickpawsey Жыл бұрын
Thanks for putting this together! Was such a cool project
@Radu
@Radu Жыл бұрын
Thank you for watching!
@lillbre6811
@lillbre6811 Жыл бұрын
Thank you so much! This was great! 🤟
@Radu
@Radu Жыл бұрын
Congratulations for getting this far :-)
@sven3707
@sven3707 Жыл бұрын
Thanks for this course Radu, was really fun and educational to follow! Would definitely watch and follow the new course you where talking about in the end of this video.
@Radu
@Radu Жыл бұрын
Awesome, thank you! :-)
@adilsonbuset738
@adilsonbuset738 4 ай бұрын
Muito obrigado, Mestre! Deus abençoe.
@Radu
@Radu 4 ай бұрын
You're welcome :-)
@williamikennanwosu
@williamikennanwosu Жыл бұрын
You are the real deal man! A real Computer Science PhD holder!
@Radu
@Radu Жыл бұрын
Glad you like the course :-)
@shambles9043
@shambles9043 Жыл бұрын
These were phenomenal tutorials! All of the content was explained clearly and with great detail. I coded along with each video, and took tons of notes so I can hopefully write a program of my own with the concepts learned. Additionally, I think it was a great idea to separate each videos files on GitHub. There were a few points where my code wasn't running, and I had to trace our codes line-for-line to find there error. Thanks again, Radu!
@Radu
@Radu Жыл бұрын
Great to hear it was worth it :-)
@arpitjangir3349
@arpitjangir3349 Жыл бұрын
Aha, the man of miracles. Took me some time but I am finally able to understand and write what you just taught. you have made into the list of my favourite people with a bang.
@Radu
@Radu Жыл бұрын
Wow! You must have learned a lot :-)
@arpitjangir3349
@arpitjangir3349 Жыл бұрын
@@Radu yes Radu. All thanks to you. I have started looking at every problem differently. Even though I have not started the ML part yet, everything else is pretty clear to me. Just focusing on what I have learnt so far and how to implement all of that in a different project. I will start a snake game project using ML after this is done. Enjoy your holiday, and please ping me on LinkedIn when you are back.
@arpitjangir3349
@arpitjangir3349 Жыл бұрын
@@Radu Hoping to work with you in future and mention your name in my portfolio. Thank you so much for teaching such beauty for free. You are a hero
@YashPoonia.7
@YashPoonia.7 2 ай бұрын
wow this is just great can't wait to complete all the phases
@Radu
@Radu 2 ай бұрын
Cool :-)
@Bogopimp
@Bogopimp Жыл бұрын
Great tutorial of the Self Driving car, thanks :)
@Radu
@Radu Жыл бұрын
Thank you :-)
@casperm7112
@casperm7112 Жыл бұрын
Thanks for the course Radu! It actually was my first machine learning project, now I kind of want to learn how to create a car that reacts to randomized traffic and makes it through all the cars.
@Radu
@Radu Жыл бұрын
Cool :-) it will be a challenge. You may want to update the sensors to detect the relative speed between your car and the others, kind of like how police radars work. Hope you succeed!
@aliph-null
@aliph-null 2 жыл бұрын
Nice work as always. Keep it up.
@Radu
@Radu 2 жыл бұрын
Thanks!
@olgierd245
@olgierd245 Жыл бұрын
I would love this kind of course. I just found gold channel wtf. Love that.
@Radu
@Radu Жыл бұрын
Glad you like it :-) Thanks for watching!
@charlymayeux8470
@charlymayeux8470 5 ай бұрын
Thanks for these lectures
@Radu
@Radu 5 ай бұрын
You're welcome!
@javifontalva7752
@javifontalva7752 6 ай бұрын
I like the ideas at the end of the vid. It would be amazing
@Radu
@Radu 6 ай бұрын
I decided Phase 2 to be something different (currently ongoing on my channel). But Phase 3 (coming in February) will be along those lines :-)
@ramjonchhen5882
@ramjonchhen5882 11 ай бұрын
So far reached the end of the project. It was a great project and learned so much from you about Neural Networks, and how to write better code and systems. The lesson you taught I used it in my college project and the response I got was phenomenal. I am forever grateful and don't have words for how much you have helped me. Thank You Radu Sir for making an awesome video like this. Forever grateful to you. Lots of love from Nepal.
@Radu
@Radu 11 ай бұрын
Happy to hear it was of so much help :-) Thanks for watching!
@pesterenan
@pesterenan Жыл бұрын
I loved the series! I'm really impressed at how you used Power Point to design the car, despite it's engine been more focused on slides... You get it? _Engine_ because you just designed a car? _oh no, no no wait!_ *fadeout* Hahhaha
@Radu
@Radu Жыл бұрын
Hahaha :-) good one!
@elescritoriodejasso
@elescritoriodejasso Жыл бұрын
Quedó bonito. Mis respetos, saludos cordiales.
@Radu
@Radu Жыл бұрын
Happy to see you finished the course :-)
@heater5979
@heater5979 Жыл бұрын
What an excellent series. Certainly I would like to see what you have in mind to build on this.
@Radu
@Radu Жыл бұрын
Glad you liked it :-) I'll definitely continue it at some point, but have to finish some other things first. May take a while...
@sharmarahul384
@sharmarahul384 2 жыл бұрын
I completed the series! I was really trying to get inside ML but couldn't find a way as I prefer javascript than python and there is not much content like this in Javascript. Once again thanks a lot❤❤❤ And yeah, please do more videos like this, like how these things work and more advanced stuff using JavaScript. I was trying to do these in javascript and then get into python and "you" really helped me! Please make more videos ❤❤❤❤❤❤
@Radu
@Radu 2 жыл бұрын
Wow :-) Congratulations! I'm happy to hear you liked the course. Good luck on your journey!
@sharmarahul384
@sharmarahul384 2 жыл бұрын
@@Radu If you have seen The Martian movie, You are the pathfinder for me!😊😊
@Radu
@Radu 2 жыл бұрын
@@sharmarahul384 One with Matt Damon? I watched it but I don't remember what the pathfinder was... I guess some machine that... finds paths :-))
@sharmarahul384
@sharmarahul384 2 жыл бұрын
@@Radu 😊 yeah self explanatory by name. It helped him connect with NASA and you helped me connect to ML and AI 😅
@Radu
@Radu 2 жыл бұрын
@@sharmarahul384 Cool :-)
@JunaidQadir-ls6pb
@JunaidQadir-ls6pb 2 ай бұрын
LEGEND!!!
@Radu
@Radu 2 ай бұрын
:-) Thanks!
@antoniosanso4650
@antoniosanso4650 Жыл бұрын
thanks for this awesome video. please please the new course .
@Radu
@Radu Жыл бұрын
I will take a break from complex stuff right now, but will keep posting this and that :-)
@clarenclarkson1914
@clarenclarkson1914 2 жыл бұрын
That intro was sensational😂
@Radu
@Radu 2 жыл бұрын
Thanks :-) Here's the extended version: kzbin.info/www/bejne/aWS8qH6Zi7ZkrNk
@clarenclarkson1914
@clarenclarkson1914 2 жыл бұрын
Pure class😁
@Radu
@Radu 2 жыл бұрын
@@clarenclarkson1914 :-)))
@revtane9
@revtane9 Жыл бұрын
you are a good teacher.
@Radu
@Radu Жыл бұрын
Thank you :-)
@revtane9
@revtane9 Жыл бұрын
@@Radu you’re welcome
@JonatanPetersson
@JonatanPetersson Жыл бұрын
This whole course was amazing, thank you! Specifically canvas and math is something I work with a lot in my current dev job, and I dabble with machine learning on my spare time so this is gold. A suggestion for a future video I would love to see - a follow-up on this project using some feed backward-loop (without any library!) instead of the genetic algorithm.
@Radu
@Radu Жыл бұрын
Thanks for the idea :-) I'm still thinking how to do it, though... For backpropagation I need to know when a move is right and when a move is wrong... And those are not clear labels in this self driving example.
@JonatanPetersson
@JonatanPetersson Жыл бұрын
@@Radu Yeah that's true. But maaaybe the labels could be set dynamically on each animation based on each ray offset. E.g. if the forward facing ray offset is small, so the car is close to collision in that direction, the label for the reverse output should be high. Or something like that.
@Radu
@Radu 7 ай бұрын
Maybe, I think I''ll manually label some things for Phase 3 (btw, Phase 2 is coming out later today :-))
@mhladen2157
@mhladen2157 2 жыл бұрын
awesome
@Radu
@Radu 2 жыл бұрын
Thank you :-)
@felipegutierrez2944
@felipegutierrez2944 Жыл бұрын
This was awesome! i would love to see more of this content. could you more real examples, please?
@Radu
@Radu Жыл бұрын
Thanks! I'll think about it. But now on summer holiday :-) so it will have to wait.
@amitlavian
@amitlavian Жыл бұрын
Great course! I was wondering how to teach the car to "wait" and slow down if there is no way around (like if there are 3 traffic cars on the same y coordinate). Thinking now to either combine the type of cars that are "following" the traffic and a car that is trying to bypass the traffic. My other thought was to create another output bit in the network that controls the speed. Definitely going to try both :)
@Radu
@Radu Жыл бұрын
They sound like great ideas :-) In principle, if your scenario will have some kind of blockade, and the cars sensors all pick-up something, it should be possible for it to learn to stop. No changes needed.
@fleckenfurz77
@fleckenfurz77 2 жыл бұрын
First of all, many, many thanks for this extraordinary video series! My thoughts: Simply amazing!! And I would like to see more! Especially more about neural networks and a bit more in detail. (unfortunately i dont have the time to do much research on my own..) Perhaps it would be nice (for others as well) to see how to combine a neural network with a genetic algorithm and (for example) train a stick figure to walk in a 2D space..? Greetz
@Radu
@Radu 2 жыл бұрын
You're welcome and HEY! That's a great idea. I actually have this game I made a while ago radufromfinland.com/projects/magicofcode/skier and it would be funny to see the character learn to ski by himself :-) I might do a tutorial on how to code the game someday as well.
@fleckenfurz77
@fleckenfurz77 2 жыл бұрын
@@Radu That would be funny indeed! xD ​ I can picture them doing funny artistic tricks/contortions in the first generations but then suddenly getting the hang of it and mastering the course... And to see you coding the skier game (btw: funny "tutorial" video ;) ) would be much appreciated as well! I haven't quite understood the rigid-body animations yet. Way above my skills. But thanks to your teaching skills i think i could actually understand it some day :D
@Radu
@Radu 2 жыл бұрын
@@fleckenfurz77 Haha :-) ok. Adding it on my list! But let's see how I prioritize it in the future (has over 300 things on it).
@Radu
@Radu 2 жыл бұрын
@@fleckenfurz77 And... I actually forgot that video had a short tutorial in it :-)) now I remember how I did it.
@abdelrahman5094
@abdelrahman5094 2 жыл бұрын
definitely make a tutorial about global composite operations
@Radu
@Radu 2 жыл бұрын
Ok. I have a beginner friendly canvas course in the works. Probably will make an intermediate one after that and that's where global composite operations could fit in. But closer to the end of the year, I think...
@devperatetechno8151
@devperatetechno8151 Жыл бұрын
i love the project and if you make the new one focused to the neural network implementations it would be amazing too, greetings!
@Radu
@Radu Жыл бұрын
Alright. Good to know you're interested! Thanks for watching :-)
@devperatetechno8151
@devperatetechno8151 Жыл бұрын
​@@Radu hey radu, just now finishing the course i added a function who generates random traffic, so, if you gonna keep the series improving the neural network would be great to test it against random traffic
@Radu
@Radu Жыл бұрын
@@devperatetechno8151 cool! Do you mind sharing the code? :-)
@devperatetechno8151
@devperatetechno8151 Жыл бұрын
@@Radu of course bro tell me by which way can i share you the code
@Radu
@Radu Жыл бұрын
@@devperatetechno8151 Any way is fine, like github, or, you can join the discord linked in my channel banner.
@codemymoney8617
@codemymoney8617 Жыл бұрын
it's an amazing tutorial and give a lot of insights. I would like to ask new video about this subject, maybe lstm, cnn or even better attention networks .. how it could be done in js ?
@Radu
@Radu Жыл бұрын
I may go in this direction as well, someday, but when I continue the series I'll focus on some simpler things first.
@aitorplaza2560
@aitorplaza2560 2 жыл бұрын
Thank you Radu. the course is awesome, well explained, and really useful. I'm looking forward for the continuation of this project. Do you think that you can add some kind of curvy road? it can be done using splines, but it can be really challenging. Based on the idea of the genetic algorithms, I've just coded one for my own research field and it work really really well. Thank you again
@fleckenfurz77
@fleckenfurz77 2 жыл бұрын
Wow! That sounds interesting! :) too bad you dont present it.. It tried (almost ^^) the same: i tried to make a car following a path (4 line segments connected to a square)... which worked fine til the car reaches the end of one line segment :/ i cant figure out how it works... nor do i have the time :(
@Radu
@Radu 2 жыл бұрын
Curvy road is not that challenging, but it's implications are :-) The dummy cars would need a more sophisticated way of steering to stay on the road... and the number of segments defining the road will increase significantly, meaning a bunch of segment intersection checks needing optimization (perhaps bounding box checks). That's great to hear that you found a solution to your problem using genetic algorithms :-)
@Radu
@Radu 2 жыл бұрын
@@fleckenfurz77 Would be interesting to see what you did :-)
@akpewlfried2123
@akpewlfried2123 Жыл бұрын
I am just seeing this and I immediately subscribed. I have some questions though: Did you use only JS to develop your ML algos ? I am also new to ML but can you recommend or make a video on how to get started with ML ? Thanks
@Radu
@Radu Жыл бұрын
Normally I use python for ML because of library support. I don't make videos using it because my audience knows mostly JavaScript and because I like to teach the inner workings of things (so, no libraries). I may make some more ML content later this year.
@akpewlfried2123
@akpewlfried2123 Жыл бұрын
@@Radu Thank you very much and I look forward to seeing your tutorial. I rank myself as your number 1 fan and aspire to become as close as possible to being a programmer like you. The journey has begun.
@notskinner2304
@notskinner2304 Жыл бұрын
Dude youtube recommended me your channel today I am really grateful it did ~>
@Radu
@Radu Жыл бұрын
Cool! Welcome :-)
@tymurgubayev4840
@tymurgubayev4840 Жыл бұрын
This is an excelent lecture, I really like the "no libraries"-style, and I'd really like to see more of this. It actually reawakened my curiosity about neural networks. Meanwhile, two small(ish) questions. 1. Doesn't the [-1, 1] interval for weights (and biases) actually limit the possibilities, because we can only get lines at an angle to the x-Axis between -45° and +45°? Isn't this bad? 2. I've tested a neural network consisting of a single layer, and it does the job just fine. Would would be a task* that requires multiple layers and this single layer one can't solve? (* a least complex extension of this simulation if possible plz so I could maybe implement it🙂)
@Radu
@Radu Жыл бұрын
1. The weight between -1 and 1 gives you the angle between -45° and +45° but what matters is the point at which the line intersects the x axis and that can be anywhere between 0 and 1 because the bias translates the line as well. 2. I actually haven't thought of a more complex variant that requires more hidden layers. I can't say for sure, but I suspect trying to teach it to overtake only on the left is one such task. Let me know if you try it.
@diegocassinera
@diegocassinera Жыл бұрын
Awesome work, thank you. I been playing around with the code added a few more games as well as auto reload, lots of fun. With my changes I can save more than one model per run, lets say the top .5%. Reload the page, reloads the models, and fills the rest of the models with mutations of the saved models. After a while, the only survivors are models created in previous runs, so the new models ended up being worst than what I had. Reducing the mutation rate seem to generate better mutations till I got close to the 90% efficiency. At that point my mutation rate was 0.0001, and the new cars are almost identical to the original nothing new seems to happen. At this point should I consider I reached the limit of the model structure and see if I can get better results adding an additional layer ?
@Radu
@Radu Жыл бұрын
Wow, you must have played with this more than me 🙂 It's hard to answer your question... I think a network with NO hidden layer might be enough for this task actually... If you use more than one hidden layer, training it with this random-ish method is going to take very long. The reason you may not see fast development is that if you keep top 5 cars (different, yet good brains), it will take 5 times longer for each of those to develop into something good.
@jagadeeshkumar5814
@jagadeeshkumar5814 Жыл бұрын
Thanks for the course radu.can we use any algorithm like cnn to do the same?
@Radu
@Radu Жыл бұрын
CNN? You mean convolutional? Yes, but then you should equip the car with some camera sensors instead. Not really applicable to this kind of infrastructure.
@jatinrastogi_vjm
@jatinrastogi_vjm Жыл бұрын
create more such project with the combination of machine learning😋😋
@Radu
@Radu Жыл бұрын
I'm planning a machine learning course at the moment. Let's see how it will go :-)
@MsPatryQPL
@MsPatryQPL 2 ай бұрын
Hey @Radu, "context.globalCompositeOperation = "multiply" slows down aplications a lot. Previous I could have 1500 cars an everything worsks smooth, but when i add this line, app allmost stops (something like 2fps). Do you have any solution to this?
@Radu
@Radu 2 ай бұрын
Sure :-) I have many solutions... but easiest would be to... still use it, but just in the constructor once. Store the colored image in an attribute and just use it on draw. If you need more colors (like for the damaged one), then just have 2 attributes... Should speedup things quite a lot. Also, warning, if you don't wait for the image to load and just do it on the first frame, the image might end up empty... so need to be careful with that.
@alamkhan6688
@alamkhan6688 Жыл бұрын
Thanks you sooo much sir for providing such a wonderful course I learned alot from it but after following the whole course I am end up having fucking first car which comes at a mid lane and I tried too much changing the ray length including number of ray count and coping your code from git hub can you please tell me what to do to avoid this thing that will be a lot of help for me sir please reply
@Radu
@Radu Жыл бұрын
Would be nice to see exactly what you are doing... Maybe record a video and show it on the discord linked on my channel banner?
@chimkariweobuseh8738
@chimkariweobuseh8738 3 ай бұрын
This is amazing! Also… how did you get your neural network to get so good?! Mine always struggles at that last intersection…
@Radu
@Radu 3 ай бұрын
Intersection? There are no intersections in Phase 1 of the course :-)
@chimkariweobuseh8738
@chimkariweobuseh8738 2 ай бұрын
Oh no, I mean the part where there are cars on lane 0 and 1, then immediately another two cars on lane 1 and 2. Mine was always struggling on that turning. But it’s fine now! In fact, I made a traffic generator, so now my self driving car is better than yours if anything >:-) I managed to copy and paste it from localStorage too! I then formatted it so that you can paste the Neural Network into the console, and it would immediately function with it as the new best car. I named mine Nebula :-) I also changed the colour of bestCar to lightblue, and cars[0] to gold. Code for Nebula’s brain (just copy and paste into console): localStorage.setItem("bestBrain", JSON.stringify({"levels":[{"inputs":[0.08561319350386676,0,0,0,0.22249395702241526],"outputs":[1,0,1,1,0,1],"biases":[-0.17123923130148958,0.3297414637178946,-0.20890619954325781,-0.580223882515022,0.043051795124983,-0.2605670628681752],"weights":[[0.05400474094974066,0.3811831612797949,-0.2985527140712422,0.6828325944929662,-0.24768850411501697,-0.01988926587527709],[0.3997301890835132,0.3019152304054429,-0.25445157971459326,0.022689781135021646,-0.3335870219263264,-0.2941487190255213],[-0.11448166260221879,0.14049258595435346,-0.29485301465184377,0.3851086151514943,-0.3290337210652232,-0.1699399040729851],[-0.16078613199031835,0.46203139400901083,0.31475523090278673,0.01064646152636703,0.26776527986983145,-0.3122256569825034],[-0.31325949942506276,-0.16306729269712436,0.08595221081437585,0.19997621648389297,0.06889575493199337,0.1470460532870061]]},{"inputs":[1,0,1,1,0,1],"outputs":[1,0,0,0],"biases":[0.21336532638785258,-0.09046694646080362,0.15445872642437775,0.46325874036597103],"weights":[[-0.052289462343601975,-0.760089601872847,0.27130057846628175,-0.005149410212754529],[-0.0013534012610567844,-0.17146986005797873,0.268556622338104,-0.12322055421239475],[0.3236128285918566,0.36644365332437223,-0.2328880531257643,0.6037142775281261],[0.7246608455148045,-0.5139190623697598,0.48445658155801713,-0.5514450419339465],[0.19011864873743245,-0.05578914086715139,-0.09689651444746367,-0.12762236258847615],[-0.07061191210665363,0.4489924286088145,-0.3837317891610247,-0.34872538971420364]]}]})); Random traffic: function generateTraffic() { const traffic = []; const a = 100; for (let i = 1; i
@chimkariweobuseh8738
@chimkariweobuseh8738 2 ай бұрын
Oh, and the getRndInteger function that I called from earlier: function getRndInteger(min, max) { return Math.floor(Math.random() * (max - min + 1)) + min; } But yeah. Thanks @Radu. I’ve learned so much, it’s crazy, honestly. You’re the best. Fun fact: At first, I found the opening song pretty cringe, but now I like it SO MUCH idk why 😂
@Radu
@Radu 2 ай бұрын
Glad you found how to debug and work with the neural networks like that :-) Those are the kind of things that will stick... Nice you're also experimenting with random traffic. Playing with things like this is really the best way to learn. Just listening to me talking is not enough!
@Radu
@Radu 2 ай бұрын
Cool! Yeah, the song :-) there are two groups, pretty much: - those who say they would subscribe, but then they heard me singing :-D - and those who sing it in their head :-D You're the first to transition between the two :-))
@Ken-S
@Ken-S 2 жыл бұрын
I wonder if the Chrome Dino can cross the road successfully?
@Radu
@Radu 2 жыл бұрын
Great! Maybe I'll make that game on top of the driving simulation :-D
@javifontalva7752
@javifontalva7752 6 ай бұрын
I would like to know more about globalCompositeOperation
@Radu
@Radu 6 ай бұрын
I think @frankslaboratory has a video on them. Not 100% sure, but check it out!
@javifontalva7752
@javifontalva7752 5 ай бұрын
When I click paste as an image it won't copy the black pieces. why??
@Radu
@Radu 5 ай бұрын
Are they all selected?
@javifontalva7752
@javifontalva7752 5 ай бұрын
@@Radu yes. I ended up download you png.
@Shalve94
@Shalve94 Жыл бұрын
Make a new course please :)
@Radu
@Radu Жыл бұрын
I'll soon publish a beginner course. After the summer break I'll think about more interesting ones :-)
@thinksmartstudios
@thinksmartstudios Жыл бұрын
How do I share my localStorage, if I wanna host my project on github, how do I do it, for any other browser, its' just one brainless car
@Radu
@Radu Жыл бұрын
You don't 'share' the local storage. But take out what's inside it. Use the console to get the string representation of the brain. Then, in your code, check if the localStorage is empty. If it is, set it to be the hardcoded string you copied from the console. You can check my code here for reference: radufromfinland.com/projects/selfdrivingcar/main.js
@thinksmartstudios
@thinksmartstudios Жыл бұрын
@@Radu I did take a reference from your code on your website, and successfully executed it, also found some code to copy my local brain and then pass it as default brain inside our main.js. Somehow my computer was easily able to simulate over 2000 cars at same time, but if I choose 1000 cars from drop down menu, our websites lag a lot. idk why.
@thinksmartstudios
@thinksmartstudios Жыл бұрын
@@Radu BTW, one last question Sir, you've used *static* functions, especially in Network.js, you told, they help us to serialise the method, but I wasn't able to correctly understand, what it really meant. I have used static members in C++ and there, if a function is called recursively in stacks, it creates only one copy of the variable, and doesn't re initializes for rest of the function calls. Similar to the term, serialization, I did solved a problem, where a class had different objects to call, and each object had to be given ID nos., so whoever gets called first, gets an ID and then we increment the ID, though, we declare, ID for each object, it's initialised only once.
@Radu
@Radu Жыл бұрын
If you convert objects into JSON, the methods don't serialize (static or not). So, when you load objects from JSON they don't have any methods. But the static methods we implemented are part of the class, so they will be always there.
@Radu
@Radu Жыл бұрын
Strange, can't imagine why it would act differently then.
@surendrasandun
@surendrasandun Жыл бұрын
I can't do even presentation in power point. But my guy do graphic design with it 😕
@Radu
@Radu Жыл бұрын
It's common that people don't even use 1% of their tools' potential :-)
@abhiseakbijaraniya2475
@abhiseakbijaraniya2475 4 ай бұрын
"Hey, I completed your self-driving course, and I made some modifications to the network functions and various small details in the code. I'm looking for suggestions for certain parts. Could you provide your email or another contact for further communication?"
@Radu
@Radu 4 ай бұрын
Cool! I don't think email is a good option. It's flooded nowadays... and I go through it rarely. I have a Discord server linked on my channel banner. I try to check that one every week.