11.3 Neuroevolution Flappy Bird with TensorFlow.js

Поділитися
Вставка
  • Опубліковано 5 вер 2024

КОМЕНТАРІ • 105

  • @secularblasphemy6627
    @secularblasphemy6627 5 років тому +96

    One of the best aspects of your videos is how you walk through the entire coding process. The ENTIRE coding process. You make mistakes and correct them (instead of just giving up.) You say, "Okay, I forget some of this, so I'm going to have to look at the documentation." You run something successfully, but it doesn't do what you want. And sometimes what it does instead is interesting, and worth revisiting later.
    Great lectures, great stuff.

    • @TheCodingTrain
      @TheCodingTrain  5 років тому +6

      Thank you for this feedback!

    • @namanmehta5243
      @namanmehta5243 5 років тому +1

      @@TheCodingTrain Hey Dan, I have a question for you, I am thinking to make a form which when I submit, I want to open a new page with the form details. I am trying this with HTML and JS. I am not sure if even I can do it without php, but still giving it a go. Let me know if you have anything you have come across something related or whatever you think about it.

    • @bagok701
      @bagok701 5 років тому

      ​@@namanmehta5243 See your other comment on this video.

  • @Draxi_1
    @Draxi_1 5 років тому +66

    I'm a Unity game developer and I just watched this whole video for some reason. Your presentation of the problem is so entertaining that I just got lost in it because every word that came out of your mouth was full of energy and had a purpose. Great job!

  • @grainfrizz
    @grainfrizz 5 років тому +19

    Siraj, this is real machine learning.

  • @kae4881
    @kae4881 4 роки тому +3

    Sir Daniel, you are the best teacher on UA-cam. I am 13 years old and because of you i know more about programming and AI than even 20 year olds. I am truly so so grateful towards you. Even though i started with python, whenever i have any problem , i look up one of your videos and totally get the topic. You're on of the best programmers around. One of my life's main goals is to meet you, and i hope you never stop making such brilliant videos. Thankyou !

  • @prestocranius7627
    @prestocranius7627 3 роки тому +3

    Watching this in 2020, there is no other channel with the quality of content this channel offers

  • @muhtasimayaz
    @muhtasimayaz 5 років тому +9

    this is exactly what I was waiting for. Now I know how to use TensorFlow.js layers in a more customised way. Thanks Daniel

  • @AbhishekSachans
    @AbhishekSachans 5 років тому +1

    I just love the way your lectures flow. So much energy flowing out of the screen.

  • @yousufkhalid8844
    @yousufkhalid8844 5 років тому +4

    I am a web developer currently starting AI also and i take much knowledge about neural networks and also AI functionalities .. Nice its really awesome .. Thanks :)

    • @yousufkhalid8844
      @yousufkhalid8844 5 років тому

      @I Understand! For AI i take start from js as i know its flow and its working so i feel easy to start with js .. and also i think that before going on machine level AI i must grip on its basics .. i.e Neural Networks, Data Training etc .. So i also suggest you take start from language you know well else if you direct start from machine language you need to learn it first .. currently i done flappy bird .. Snake game .. and relevant short Ai base programs

    • @yousufkhalid8844
      @yousufkhalid8844 5 років тому

      @I Understand! need any help free to talk :)

    • @yousufkhalid8844
      @yousufkhalid8844 5 років тому

      @I Understand! Node Js

  • @Xy-gx8ou
    @Xy-gx8ou 5 років тому +2

    So recently i thought to myself: hey Im interested in AI, let's see if I can make a nn myself. Was a bit disappointed after I put several hours in without any real progress. And now Daniel is uploading this gem. Thank you so much, i will definitely watch through and try it on the weekend myself!

    • @dooby1445
      @dooby1445 5 років тому

      Xy you can do anything you set your mind to

  • @FerMJy
    @FerMJy 5 років тому +7

    oh.. i thought this chapter was over... nice you are back with Neuroevolution!!
    Can you do something about (deep)Q-Learning and A3C? (more interested in Q-Learning)

    • @TheCodingTrain
      @TheCodingTrain  5 років тому +5

      Eventually I hope!

    • @FerMJy
      @FerMJy 5 років тому +2

      @@TheCodingTrain Daniel.. I want to thank you for your hard work.
      I'm suffering the "Coder's Block"... I wasn't able to understand the most simple algos.. simple codes, anything. And the worst thing, I wasn't able to code.. I got frozen in front of the screen like a plant.
      This was happening me for about 1 year...
      So, with a lot of work (reflection and the help of my therapist).. I decided a couple of weeks ago to try something different.. I started from scratch... I found a lot of papers... blogs... code examples... but the most important... youtubers like you that program...
      And now.. i'm not "cured" 100%... but i can program and understand code again!! Even more complex code that i was able to understand before i got the block.
      I hope you read this.. You do more than teaching...
      So thank you Daniel Shiffman :)

    • @TheCodingTrain
      @TheCodingTrain  5 років тому +5

      @@FerMJy I am so glad to hear this!

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

    the content is great, but I am on the fence on if it is good for learning or not. I start thinking I understand what is going on, then he realizes he made a mistake and quickly changes things, and I am not sure if I am remembering the corrected part or the original. Still great to hear him work through the problems and logic, and while explaining so well.

  • @Kerr_Avon
    @Kerr_Avon 5 років тому +1

    Thanks for all the videos and tutorials Dan! I went through all of the Nature of Code book, and was really interested in the Neuroevolution section. I made my own version of the flappy bird game a while ago and recently decided to see what a 3d version would look like and how would the neural network behave. Here is what I came up with editor.p5js.org/djuliette/sketches/aGEe50IFd

  • @hck1bloodday
    @hck1bloodday 5 років тому

    please don't stop with these videos, I love them all, igf you have a son make him tech for you when you get older

  • @vs4vijay
    @vs4vijay 5 років тому +1

    Great Video!!
    Suggestions:
    - Generally JavaScript used camelCase variables and functions, so the variables you created "input_nodes" and "hidden_nodes" should be "inputNodes" and "hiddenNodes".
    - You could make use of "async-await" feature of javascript to deal with promises and callbacks... e.g. const outputs = await ys.data();
    - Why can't you use Object.create(this.model) to create copy new model?

    • @TheCodingTrain
      @TheCodingTrain  5 років тому

      Thanks for this feedback! I didn't try Object.create(), the question is whether it would be a "deep" or "shallow" copy I think?

  • @henriquevoni2481
    @henriquevoni2481 5 років тому +1

    If you are not using crossover for evolving in each epoque, then you may be more close to a Immune System algorithm (look for Clonal Selection)

  • @RicoGalassi
    @RicoGalassi 5 років тому +2

    Always a good time when I get the notification for a new vid of yours!

  • @brahimbenouda5281
    @brahimbenouda5281 5 років тому +1

    BEST TEACHER EVER, keep going

  • @makarandlahane3904
    @makarandlahane3904 5 років тому +7

    You are a huge inspiration for me!!!!

  • @smilingx4-189
    @smilingx4-189 3 роки тому

    Really nice courses thank you for your investment. I will now copy paste your beautiful code in my app and conquer the world.

  • @gilribes8401
    @gilribes8401 5 років тому

    This video is greatly explained and makes neural networks look easy!

  • @8eck
    @8eck 4 роки тому

    Exactly! We can solve it with if statements. Need a more complex example! :)

  • @yochan9337
    @yochan9337 5 років тому +1

    It's so much more complicated than the previous version :D
    You should also try neataptci.js there's some cool stuff purposely designed for neuroevolution

  • @techrider5733
    @techrider5733 5 років тому +1

    Finnaly I've been waiting forever for this. I know how it works but I don't know how its made. I'm just really fascinated about how they work with all of the possibilities . I honestly don't know how @the coding train does it but I tip my hat to you. So keep doing what your doing, and I can't wait for the next one.☺

    • @chiefvoldemort1321
      @chiefvoldemort1321 5 років тому +1

      Same here. I know the basics of how neural networks and training works and can implement a crude prototype by myself but I don't know how to use all these librarys.

    • @techrider5733
      @techrider5733 5 років тому

      Exactly

  • @FabledNarrative
    @FabledNarrative 5 років тому +1

    Human moment!
    @ 3:43
    (thought) "UHHH..." (thought)
    Keep doing what you do Daniel! :D

  • @ZombieBestOfficial
    @ZombieBestOfficial 5 років тому +2

    Great one! 😍

  • @aminzarei1557
    @aminzarei1557 5 років тому

    A great start to integrate tfjs with neuroEvolotion ,Thank you for your perfect video. can you make another video for implementing "NEAT" in tfjs plz.

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

    Yet another awesome video! Thank you mr. Coding Train. I was wondering thought , is this approach superior to the NEAT algorithm ?

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

      I would say NEAT is probably superior to this? My examples are a simplified, less sophisticated version of NEAT.

  • @jamesharushi409
    @jamesharushi409 5 років тому

    This is what I listen to when I go to sleep because coding is seen as relaxing to me

  • @8eck
    @8eck 4 роки тому

    There wasn't any lesson about weights and bias in your previous lessons. :) Only high-level explanations of them. Would be nice to understand the magic behind all these calculations and what is going on on the background.

  • @theprogrammer2567
    @theprogrammer2567 5 років тому

    Maybe u could another series on the NEAT algorithm? I think it would be a good continuation from Neuroevolution

  • @OneShot_cest_mieux
    @OneShot_cest_mieux 5 років тому +1

    Amazing as always !
    Please someone tell me, is it really necessary to clone the weights while the tensors are not mutable ?

  • @theprogrammer2567
    @theprogrammer2567 5 років тому +1

    Could you do a tutorial on how to save and load TensorFlow.js models, thanks

  • @bjoernsan99
    @bjoernsan99 5 років тому +1

    I really enjoyed this video! Waiting for more

  • @8eck
    @8eck 4 роки тому

    random(1) < rate was the most coolest things :D

  • @AbdealiSaria
    @AbdealiSaria 5 років тому +1

    do we use reinforcement learning in this video at all? or is it just a genetic algorithm with NN..sorry if sound like an idiot, dont know about this stuff. Thanks !

    • @fr3fou
      @fr3fou 4 роки тому

      have you figured this out yet?

  • @raghavgarg1258
    @raghavgarg1258 4 роки тому

    Great Sir

  • @andylo8149
    @andylo8149 5 років тому

    this is so useful for me. Thank you so much! Could you please go through the slow running speed of tf.js please? I face the same issue too and have no idea how to fix it...

  • @sanchitverma2892
    @sanchitverma2892 5 років тому +5

    hi daniel, just found your channel recently and I'm loving it. I see you have a great influence on your audience. I recommend you to try out other harder programming languages like python or c++ so people could understand it using your knowledge,if you understand what I'm saying.
    p.s. you're the best fucking teacher in the entire world I don't think you realise that

    • @yeetskeet691
      @yeetskeet691 5 років тому

      I believe he's a professor at a university

    • @samplasion
      @samplasion 5 років тому

      sanchit verma same

  • @ajinneramit1880
    @ajinneramit1880 4 роки тому

    So mutate is just add random 10% number to those weights? Or gradient descent then save those weights after?

  • @siddharthyanamandra9427
    @siddharthyanamandra9427 5 років тому

    I have always enjoyed your videos. Could you please make a video on NEAT!!!!

  • @theprogrammer2567
    @theprogrammer2567 5 років тому

    Could you also do a tutorial on how to show the best performing bird of the current generation, thanks

  • @edwincarlsson9014
    @edwincarlsson9014 5 років тому +1

    Beautiful!

  • @husseinnajafli2305
    @husseinnajafli2305 5 років тому +1

    Programming ❤️

  • @Llink4n
    @Llink4n 3 роки тому

    You are the best

  • @sps014
    @sps014 5 років тому +1

    great work

  • @anuraghazra4772
    @anuraghazra4772 5 років тому

    very close to 800k

  • @8eck
    @8eck 4 роки тому

    w + randomGaussian() should it be normalized after that?

  • @codeforest9027
    @codeforest9027 5 років тому

    Wooooooooooooow cool project! And that too like an hour ago

  • @harshaaddanki4606
    @harshaaddanki4606 3 роки тому

    use the Model class in tf.layers i'ts cool

  • @kamingcheung7681
    @kamingcheung7681 4 роки тому

    Do you know how to run Tensorflow in python for modeling and run the flappy bird game in javascript?

  • @CzolguRecordingAgain
    @CzolguRecordingAgain 5 років тому

    pozdrowienia z wiezienia

  • @bagok701
    @bagok701 5 років тому

    Hiya your tutorial index doesn't have chapters 11,13,17 as of writing.

  • @tx6723
    @tx6723 5 років тому

    considering trying to do this with phaser

  • @suraj-ram7488
    @suraj-ram7488 5 років тому

    Awesome video, I love these

  • @coolcatgamestudio
    @coolcatgamestudio 5 років тому

    Great video!

  • @lonnybulldozer8426
    @lonnybulldozer8426 5 років тому

    Wait, you're teaching a class on this? Is that available somewhere?

  • @lamninh9131
    @lamninh9131 4 роки тому

    I very stuck now with my coursework about genetic algorithms using evolutionary like Using Real-Valued Genetic Algorithms to Evolve Rule Sets for classification, please any guys can suggest the way I should do thank you very much

  • @alejandroulisessanchezgame6924
    @alejandroulisessanchezgame6924 5 років тому

    hello i recently start seeing your videos and are amazing. Sorry about my poor english i'm still learning. If there any chance can you do a procedural generate algorithm like dwarf fortress. Not a complete at that level, but at least a 10%. thankyou

  • @timurthe_hacker6684
    @timurthe_hacker6684 5 років тому

    I LOVE PYTHON

  • @GoatzAreEpic
    @GoatzAreEpic 5 років тому

    u crazy smart fam

  • @namanmehta5243
    @namanmehta5243 5 років тому

    Hey Dan, I have a question for you, I am thinking to make a form which when I submit, I want to open a new page with the form details. I am trying this with HTML and JS. I am not sure if even I can do it without php, but still giving it a go. Let me know if you have anything you have come across something related or whatever you think about it.

    • @bagok701
      @bagok701 5 років тому

      same as opening a popup, [3] or clearing the current window[5][6] or cover the current view with an opaque layer[4]. Look to this documentation [1][2] and lastly here's a tutorial to do the evil [3]
      [1] developer.mozilla.org/en-US/docs/Web/API/Document_Object_Model/Introduction
      [2] developer.mozilla.org/en-US/docs/Web/API/Window/open
      [3] html.com/javascript/popup-windows/
      [4] www.w3.org/TR/css3-values/#viewport-relative-lengths
      [5] developer.mozilla.org/en-US/docs/Web/API/Document/all
      [6] document.open()

  • @ForEverybody
    @ForEverybody 5 років тому

    You are always great

  • @muhtasimayaz
    @muhtasimayaz 5 років тому

    just curious how would you save and load the weights once I have found the best bird?

    • @TheCodingTrain
      @TheCodingTrain  5 років тому

      I have an example that does that here!
      github.com/shiffman/Tensorflow-JS-Examples/ (Look at 04)

    • @isaacstrzyga3286
      @isaacstrzyga3286 5 років тому

      @@TheCodingTrain umm i tried ur example but it keeps giving me the error imgur.com/X80aZuw can u explain for me xd

  • @gabrilrh
    @gabrilrh 5 років тому

  • @ghostly_zsh9609
    @ghostly_zsh9609 5 років тому

    My challenge for you is to create a pong in js file on an html file without the p5.js library

  • @matiasvlevi6647
    @matiasvlevi6647 5 років тому

    Is there a tutorial on how to make the actual NN?

    • @TheCodingTrain
      @TheCodingTrain  5 років тому

      Maybe try this playlist? ua-cam.com/video/XJ7HLz9VYz0/v-deo.html

  • @madigor9264
    @madigor9264 5 років тому

    is it possible to implement q-learning in javascript with flappy bird environment?

  • @winsshhh
    @winsshhh 5 років тому

    What company are you working?

  • @kleinpoe
    @kleinpoe 3 роки тому

    You can just mutate your values without making a copy, as you are assigning it back in the end anyway

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

      You do need a copy because of the selection process.

  • @ByulTon
    @ByulTon 5 років тому

    love this video.
    very useful for me.
    i want to get weight and bias data.
    is this code correctly for get model data?
    let weights = birds[0].brain.model.getWeights()[0].dataSync();
    let hidenLayerBias = birds[0].brain.model.getWeights()[1].dataSync();
    let hidenLayerWeight = birds[0].brain.model.getWeights()[2].dataSync();
    let output = birds[0].brain.model.getWeights()[3].dataSync();

  • @metadaat5791
    @metadaat5791 5 років тому

    Wait, if you're not using cross-over, then why are you not using Simulated Annealing, instead of a Genetic Algorithm? There's really no upside, and SA is both easier to code and has less parameters to tweak in order to get a fast convergence to an optimal solution. SA very roughly looks like a GA with a population of 1, but it's subtly different. Wikipedia has a good article outlining the basic strategy.

    • @TheCodingTrain
      @TheCodingTrain  5 років тому

      Thanks for pointing this out! I think one difference here is that I maintain the idea of "generations" and a population of N elements?

  • @aayushsingh8885
    @aayushsingh8885 5 років тому

    Plzz make chain reaction game with p5.js

  • @sarangs8441
    @sarangs8441 5 років тому

    When's mnist with tf.js

  • @FerMJy
    @FerMJy 5 років тому +1

    I was thinking... "22:36 oh... ok.. it was the console.log......" "31:31 nope... everything related with Python has to be bad.." (I hate Python and its libraries)
    Thanks for the video, now i know that TensorFlow is bad even in JS. It wasn't enough with Python and C#...

  • @SuperDomKiki
    @SuperDomKiki 5 років тому

    \o/\o/\o/ All praise tf.tidy() \o/\o/\o/

  • @YitzharVered
    @YitzharVered 5 років тому

    Make one that solves a rubix cube m8

  • @ColeNOXyd2nd
    @ColeNOXyd2nd 5 років тому

    it hurts that you realize you are repeating yourself, saying "once again", and not extract the same part into a function