Coding Challenge

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

Komentáře • 82

  • @israrawan
    @israrawan Před 6 lety +25

    At 7:23, line (linear function) represents the prediction. A point belonging to a line must be labelled as "guess", whereas the original label of every example should be labelled as "y". [Slip of 'marker' maybe] Nice video though. 'Desperately' waiting for Layers API video. :)

    • @TheCodingTrain
      @TheCodingTrain  Před 6 lety +4

      Ah, shoot, you are absolutely right. Pinning this comment!

    • @BrettCooper4702
      @BrettCooper4702 Před 6 lety

      Visualising that whiteboard at 7:23 ish, as coding challenge using in P5 to animate whiteboard drawings as an interactive data visual.
      #bounty :)

  • @cashel1111
    @cashel1111 Před 6 lety +40

    that 'dan from the future' correction was done in good taste, and was very useful (plus entertaining)
    very very good way of making sure you cover topics properly :)

  • @MatthewBishop64
    @MatthewBishop64 Před 5 lety +3

    This is a million times better than commercial courses like Udacity's AI "nanodegree" where they drive around in a self-driving car trying to show you how amazing and successful they are.

  • @muhammedshameel5684
    @muhammedshameel5684 Před 6 lety +6

    I love this channel because it has time travels. love it when he does that

  • @israrawan
    @israrawan Před 6 lety +12

    There is this pretty cool 'syntax' to define a variable in tensorflow.js. Instead of wrapping the tf.scalar around the tf.variable (13:00), we can actually use chaining. For example: tf.variable(tf.scalar(random (1))) is same as tf.scalar(random(1)).variable(). [As I am reading documentation while watching this video, I thought I should share this "syntactic sugar"]

  • @MajorMandyKitten
    @MajorMandyKitten Před 6 lety +4

    Your videos keep getting better. I generally use c++ and c#, but your videos are good for finding fun ideas and useful ideas. Keep it up, man!

  • @terjeoseberg990
    @terjeoseberg990 Před rokem

    SGD changes m and b in small steps in the direction of the gradient. The step size is determined by the learning rate. It’s not random, but the direction of the gradient can change as it learns, so it needs to be recalculated after each time m and b are updated.

  • @caiovitullo4584
    @caiovitullo4584 Před 5 lety

    I've done many ML courses, but yours way to explain is being the best! Congratiulations!!!

  • @RingoDemichet
    @RingoDemichet Před 6 lety +10

    Hooray ! A coding challenge with tensorflow !

  • @braidata
    @braidata Před 2 lety

    Antes de ver el video, el solo hecho de que sea de Daniel, me hace sentir que por fin desbloquearé este tema del todo y en javascript. Gracias Daniel, en mi caso el mejor profesor!

  • @laikesagores3258
    @laikesagores3258 Před rokem

    This is out of my range!!!

  • @Osmosphere
    @Osmosphere Před 3 lety

    Wow - thank you so much! Finally found an great introduction to TensorFlow.js and machine learning that I understand and makes fun! I added the loss value as additional line to the graph :-)

  • @HamzaAli-nc5fx
    @HamzaAli-nc5fx Před 5 lety

    I love you sir. You have my respects. I never took interest in machine learning but after watching the previous videos and this one, I am surely gonna dive more into it. Thank you again.

  • @carllee6422
    @carllee6422 Před 6 lety +2

    finally get the real example with tensorflow js
    coool

  • @stevegalili355
    @stevegalili355 Před 6 lety +1

    Yayyy! Keep up the good work Daniel

  • @oswaldd3110
    @oswaldd3110 Před 3 lety +1

    the future thing was awesome :D

  • @fluencygod1045
    @fluencygod1045 Před 6 lety +1

    I first noticed that a tensor flow was possible with js.It's very very amazing!!

  • @acorad30
    @acorad30 Před 6 lety

    omg didn't notice it lasted 44 minutes! It was a blast, good video!

  • @edujbb83
    @edujbb83 Před 6 lety +1

    Thanks for your video tutorial, they are great.

  • @madebymate4870
    @madebymate4870 Před 2 lety

    great tutorial bro

  • @applebanana6149
    @applebanana6149 Před 6 lety

    Excellent! Now we're coding with Power!

  • @shashankmadan
    @shashankmadan Před 6 lety

    THE FUTURE THING WAS JUST AWESOME!!!!!!!!!!!!!!!!!!!

  • @ramseshendriks2445
    @ramseshendriks2445 Před 6 lety

    2:25 in fact that is not a linear relation in reality.
    because mass grows with volume and volume grows with the third power of lenght

  • @blasttrash
    @blasttrash Před 6 lety

    the future dan was awesome lol. i felt like i was really watching a movie. :P

  • @eltitanthanos6568
    @eltitanthanos6568 Před 6 lety

    Pro, your ability to coding is amazing, you must let the virtual come out to reality, you should program arduino and create a incredible project genetic algorithm neuronal net evolution robot

  • @christianjt7018
    @christianjt7018 Před 6 lety

    awesome project :)

  • @allaheadflank
    @allaheadflank Před 5 lety

    Thanks!!

  • @diegofernandorueda9160
    @diegofernandorueda9160 Před 6 měsíci

    at minute 18 the Sub() function, what is the use? and could it be done in other ways for this linear regression?

  • @Grynjolf
    @Grynjolf Před 5 měsíci

    I don't know anything about tensor flow, but are you not able to just get the trained m and b values and draw the line with those?

  • @rubix4716
    @rubix4716 Před 6 lety

    Do you have a tutorial on how you create your coding environment?

  • @psylocke1517
    @psylocke1517 Před 6 lety

    do you ever get bored coding? im 17 and i think u have the years of experience same as my age. i'm taking the first baby-steps of coding and i love it but can't do it for long. how do you keep yourself motivated and curious?

  • @Eddytorial
    @Eddytorial Před 5 lety

    u should do a tutorial about that how future of you breaking in the middle :) that was some Hollywood material :) like it :))

  • @forloop7713
    @forloop7713 Před 6 lety

    but a height vs weight function isn't typically linear, and shouldn't be represented with a line, since weight scales with the cube of height.

  • @wojtek4351
    @wojtek4351 Před 5 lety

    I don't really understand the point of storing x and y positions of points as numbers from 0 - 1 if we are gonna convert them back to their initial form? As in what is the point of mapping mouseX from 0 - 1 if we are later just converting it back to 0 - width?

  • @marcosrios3626
    @marcosrios3626 Před 6 lety

    5:28 when my teacher asks me a question

  • @darogajee3286
    @darogajee3286 Před 6 lety

    Unable to draw the line..... After writing plotted point function

  • @JosephHenryDrawing
    @JosephHenryDrawing Před 6 lety

    What are the only five Tensors left with tf.memory().numTensors ? (there's m,b and ...)

  • @leanobajio
    @leanobajio Před 6 lety

    I'm entertained.

  • @OneShot_cest_mieux
    @OneShot_cest_mieux Před 6 lety

    Why is there 5 tensors instead of just 2 at the end ?

  • @minhnhattranle3392
    @minhnhattranle3392 Před 5 lety +1

    Daniel code a time machine...

  • @JimishFotariya97
    @JimishFotariya97 Před 6 lety +1

    tf.variable( obj ) also works as obj.variable()

  • @username42
    @username42 Před 5 lety

    where is the codes he used in this video ? in which github repo?

  • @puipuiboi6386
    @puipuiboi6386 Před 6 lety

    why you taking width and height of the canvas from 0 to 1? how it makes it better? what if i take it as the total width and height of the canvas

    • @aaron7c
      @aaron7c Před 6 lety +1

      WhatTheHACK! I think that the minimize function may take in a normalized (between 0 and 1) number or something like that. I’m not exactly sure why they normalize numbers on a canvas but I think it has to do with how the answer to a neural network usually is a Boolean (yes or no) which is between 0 and 1 (0 being no and 1 being yes.. and in-between being how sure it is of the answer )

  • @puipuiboi6386
    @puipuiboi6386 Před 6 lety

    is it wrong to take distance of the point to the line as perpendicular distance? will it affect the solution in any way? please answer :)

    • @iLavaRF
      @iLavaRF Před 6 lety +1

      It is not wrong, it is actually a better approximation but the math and coding is just harder.

  • @souvikkhan9494
    @souvikkhan9494 Před rokem

    can anyone send me the complete code

  • @rained23JMTi
    @rained23JMTi Před 5 lety

    optimizer.minimize(() => loss(predict(x_vals), ys));
    what does this code actually do ? as I dont see it related to below code as const ys are re-declared at the bottom of draw function. Thx.

  • @melvinlijiabraham4165
    @melvinlijiabraham4165 Před 6 lety

    With "rmsprop" optimizer, I got 2 lines at the same time...

  • @rained23JMTi
    @rained23JMTi Před 5 lety

    why do you create m and b with random 1 tensor ?

    • @scepto43
      @scepto43 Před 4 lety

      like in any project, you need to start somewhere, so he uses some random variable as a starting point

  • @mikelezhnin8601
    @mikelezhnin8601 Před 6 lety

    Where is the github page for this? Or am I just blind and it is right there in the description?

    • @TheCodingTrain
      @TheCodingTrain  Před 6 lety +2

      I need to do a better job of being more clear where to find the code.
      thecodingtrain.com/CodingChallenges/104-linear-regression-tfjs.html
      github.com/CodingTrain/website/tree/master/CodingChallenges/CC_104_tf_linear_regression

    • @mikelezhnin8601
      @mikelezhnin8601 Před 6 lety

      Thanks Daniel!

  • @mickolesmana5899
    @mickolesmana5899 Před 6 lety

    i am still confused about why do it need to be squared? can someone explain to me

    • @blasttrash
      @blasttrash Před 6 lety +2

      are you referring to the squared error? if so in most of the math applications you use that to avoid polarity. Like you just want the difference between two numbers and you don't care about their sign.
      For example take two numbers 2 and 5. The difference between them is 3. However depending on which comes first, your subtraction may give you different results. That is
      2 - 5 = -3 while
      5 - 2 = 3
      In linear regression, you are only concerned with 3(which would be your error for that data point). You are not concerned about the negative sign or positive sign.So to avoid having to worry about negative values, you usually square them. So both -3 and 3 would become 9. Eventually you would still be reducing the error that way. Hope it explains.

    • @rained23JMTi
      @rained23JMTi Před 5 lety

      @@blasttrash thanks for explanation, so by squaring even the value become 9, it doesnt affect the output that we want ? like it should be 3 not -3 or 9

    • @blasttrash
      @blasttrash Před 5 lety +1

      @@rained23JMTi True, I guess it does effect the output a bit, but it only effects the speed at which we find the answer I guess. I mean if we took 3, we would probably reduce that error 3 to being 0(or close to 0) within say 2 iterations. On the other hand, if we took it as 9, it would probably take 5 iterations. But in the end, it doesnt matter since we will be solving or reducing the error down to zero in either of those cases.
      Now I am pretty sure there are some other advantages of squared error(although idk what they are). If you check this wiki link, it talks about some bias and variance, I guess thats where the answer lies. However I do not fully understand those concepts, so I will wait until someone more knowledgeable answers it.
      en.wikipedia.org/wiki/Mean_squared_error

    • @matpetics
      @matpetics Před 5 lety

      @blasttrash haha...look at 5-2=3 and 9-12=-3, and if we add them we get 0. But 2 is not a good approximation to 5 nor 12 is to 9. That's just one reson. The other one is that square function is smooth, and when we want to find a (local) min or max it's easier to work with differentiable functions. And the third reason is that square function is also convex, which makes optimizatiom much much easier. The local optimum is global!

  • @rutgerdegraaf5277
    @rutgerdegraaf5277 Před 6 lety

    lol do you have a green laptop on your left? =) 12:20

    • @RingoDemichet
      @RingoDemichet Před 6 lety +1

      Yep he does, he uses it to manage his stream, the chat and so on I believe :)

    • @TheCodingTrain
      @TheCodingTrain  Před 6 lety +2

      yes, this is correct!

  • @lmmartinez97
    @lmmartinez97 Před 6 lety

    There's something i don't really understand.
    I've made a program similar to this, but on Fortran. When I was taught how to do it, all they said was "you just throw in two vectors with your data, and make the program return two coefficients that plot the line". How is this any faster or more efficient than just making the computer operate with arrays? I don't understand why you specifically need to make them tensors -i assume it is because tf functions only accept tensors as arguments-. Does the implementation of the optimizer as a native function make the execution any faster?

  • @aleksandermagda8412
    @aleksandermagda8412 Před 6 lety

    0:39 Have you liked your own video ? :D

  • @oscarmejia8306
    @oscarmejia8306 Před 5 lety

    im confused af

  • @PietroYT
    @PietroYT Před 5 lety

    Thank you for your great work. It really helps. I just wanted to share an implementation done with React.js and SVG. github.com/gpietro/reactflow-linear-regression

    • @TheCodingTrain
      @TheCodingTrain  Před 5 lety

      Nice work! You can submit a link to the coding train website if you like!
      github.com/CodingTrain/website/wiki/Community-Contributions-Guide

  • @roizdoci
    @roizdoci Před 6 lety

    are you using braces? you speech changed.... you sound like you're using braces or have lisp tongue. lol