Gradient Descent From Scratch in Python - Visual Explanation

Поделиться
HTML-код
  • Опубликовано: 5 сен 2024
  • In this video we implement gradient descent from scratch in Python. Also I try to give you an intuitive and mathematical understanding of what is happening.
    ◾◾◾◾◾◾◾◾◾◾◾◾◾◾◾◾◾
    📚 Programming Books & Merch 📚
    🐍 The Python Bible Book: www.neuralnine...
    💻 The Algorithm Bible Book: www.neuralnine...
    👕 Programming Merch: www.neuralnine...
    🌐 Social Media & Contact 🌐
    📱 Website: www.neuralnine...
    📷 Instagram: / neuralnine
    🐦 Twitter: / neuralnine
    🤵 LinkedIn: / neuralnine
    📁 GitHub: github.com/Neu...
    🎙 Discord: / discord

Комментарии • 38

  • @cerealport2726
    @cerealport2726 Год назад +11

    This is a very nice video explaining the mysteries behind gradient descent!
    The greek "n" looking symbol is eta, as far as I am aware.

  • @markosth09
    @markosth09 Год назад +11

    The greek letter "η" is called eta.

  • @navsquid32
    @navsquid32 4 месяца назад +1

    I’d recommend implementing a higher-order finite difference scheme for computing the gradient instead of hard-coding the analytic derivative for those who want to implement more general schemes.

  • @ivanbg6908
    @ivanbg6908 Месяц назад +1

    What compiler do you use? I use VSCode but I can not change the perspective of the 3DPlot. Thanks for the video.

  • @lilprotakeit
    @lilprotakeit Год назад +1

    Super Awesome .. Wonderful explanation and i can understand this video has some prerequisite .. but what you can do is leave some references to people who are not graduated to this level

  • @dizoner2610
    @dizoner2610 Год назад +2

    I spent around 490 hours learning calc 3 , now I gotta implement this algorithm, thx u for explanation

    • @unknown__user__800
      @unknown__user__800 Год назад

      You counted the hours😮

    • @dizoner2610
      @dizoner2610 Год назад +2

      @@unknown__user__800 yeah I actually did just to see how productive (I guess I can say ) I am

  • @sandipandutta8776
    @sandipandutta8776 3 месяца назад

    at the end, when you plotted 3 points, you only adjusted the x and y coordinates, but did not change the z coordinate. it was still z_function(0.7, 0.4)

  • @mohammedk8545
    @mohammedk8545 10 месяцев назад +1

    16:16 Rollercoaster !!

  • @prashantm9856
    @prashantm9856 Год назад +2

    Very educational bro ,I love it❤

  • @mugen-one
    @mugen-one 4 месяца назад

    Great explanation and good visuals!

  • @alanbal888
    @alanbal888 Год назад

    Thank you so much, it really helped me out understanding the gradient descent :)!!!

  • @unknown-ie3ik
    @unknown-ie3ik Год назад +4

    Aaaawesome, as expected 🔥🔥
    Could you do logistic regression

  • @alibastami
    @alibastami 5 месяцев назад

    Thank you brother, this was immensely helpful

  • @nancybm41
    @nancybm41 11 месяцев назад +2

    thanks for the video. great job. I think you forgot to update the z function with the correct x and y values for positions 1-3.

  • @incrediblehuman1173
    @incrediblehuman1173 8 месяцев назад

    Thank you, very well explained 🙏

  • @thomaskwesimwaba9151
    @thomaskwesimwaba9151 11 месяцев назад

    Thank you very much for the video 🙌🏽

  • @unknown-ie3ik
    @unknown-ie3ik Год назад +1

    Thank you very much

  • @introtoprogramming9162
    @introtoprogramming9162 9 месяцев назад

    Great Explanation..👍

  • @yakupkaanbaycan9316
    @yakupkaanbaycan9316 Год назад

    Great video, thanks

  • @sharjeel_mazhar
    @sharjeel_mazhar 4 месяца назад

    Can anyone please teach me how to take the derivatives of this function: [sin(5x) * cos(5y)] / 5

  • @SteffCelTare
    @SteffCelTare 5 месяцев назад

    Love this video

  • @user-xj1pi5ec6x
    @user-xj1pi5ec6x 9 месяцев назад

    very clean

  • @Mar-ts4bn
    @Mar-ts4bn 8 месяцев назад

    Is that work with multiple features datasets?

  • @swapnilnangare5805
    @swapnilnangare5805 3 месяца назад

    I getting error in computed_zorder anyone is there any update

  • @danielsehnoutek2016
    @danielsehnoutek2016 10 месяцев назад

    great tutorial

  • @ajeetsbpr
    @ajeetsbpr Год назад

    awesome bro

  • @foodfunk6730
    @foodfunk6730 7 месяцев назад

    Awsm. When I run the code in colab, I get multiple plots. One plot for each iteration. It seems that plt.clf() is not clearing the plot. Can you please answer why its happening. Here is the code
    def y_function(x):
    return x**2
    def y_derivative(x):
    return 2*x
    x = np.arange(-100,100,0.1)
    y = y_function(x)
    current_pos = (80, y_function(80))
    learning_rate = 0.01
    for _ in range (100):
    new_x = current_pos[0] - learning_rate*y_derivative(current_pos[0])
    new_y = y_function(new_x)
    current_pos = (new_x,new_y )
    plt.plot(x, y)
    plt.scatter(current_pos[0], current_pos[1], color='red')
    plt.pause(0.1)
    plt.clf()

    • @garydixter4407
      @garydixter4407 6 месяцев назад

      I got the same issue
      did you find any solution?

  • @god_puzzle
    @god_puzzle 10 месяцев назад

    Amazing

  • @applepie7282
    @applepie7282 Год назад

    thx

  • @hejrey6228
    @hejrey6228 11 месяцев назад

    10/10

  • @taruchitgoyal3735
    @taruchitgoyal3735 Год назад

    Hello Sir,
    When I execute: -
    ax=plt.subplot(projection="3d", computed_zorder=False)
    AttributeError: 'Axes3DSubplot' object has no property 'computed_zorder'
    Can you please suggest how to resolve the problem?
    Thank you

  • @thomasgoodwin2648
    @thomasgoodwin2648 Год назад

    Calcuwho? The progging I get (mostly). The maths (While I do understand the underlying principles) somehow always produce soup when I try it (a form of dyslexia). The cool part is that these days we have new tools to extend ourselves mentally (and not at all in any naughty ways like some of you might be thinking despite 40% of the internet being dedicated to porn) such as Wolphram Alpha and ChatGPT. Using such tools allows us to extend the boundaries imposed by our own personal mental limitations.
    To those of you who might be a bit more like me and fear treading the murky reef filled waters of higher maths remember that even if the mechanics elude you, a basic understanding is enough to use these tools to supplement ones capabilities. Even those who are well versed in math would be wise to make use of them given our roughly 15% error rates. Let the machine do the heavy lifting for the difficult and/or complicated bits.

  • @vasupatel7013
    @vasupatel7013 Год назад

    Hey can you please guide me, I am at begginer level , I am trying to built a python script or model which can detect wheather a pdf is an image one or non image , I got stuck at one problem: even if pdf is non image because it contains some type of stamps in it , it is considering it as image file and I am unable to segregate files , can you please suggest what should i do in this case.

  • @user-ot8ri8sd7s
    @user-ot8ri8sd7s Год назад

    Best tutorial ever seen