udacity / deep-learning-v2-pytorch

Projects and exercises for the latest Deep Learning ND program https://www.udacity.com/course/deep-learning-nanodegree--nd101
MIT License
5.26k stars 5.32k forks source link

Incorrect forumla for derivative of z with respect to x in section autograd #388

Closed umerkhan-mas closed 2 years ago

umerkhan-mas commented 2 years ago

The derivative formula shown in autograd is not true for all cases. It will only show the correct answer for n=2. This was highly confusing for me and took a lot of time to figure out.

ronny-udacity commented 2 years ago

Hi @umerkhan-mas Thanks for submitting the PR. The final calculation on the jupyter notebook (ie. x/2) is correct. But I understand it can be confusing for some students to derive this calculation. Your PR can help other students to understand the steps.

However, before we merge this PR, there are two things that need to be done: 1) please make your changes in the solution notebook, instead of the exercise notebook (the exercise notebook is intended to be blank for students to practice the codes and calculations). 2) on your notebook, it says for n=2. I believe it should be for n=4 since there are 4 elements in the "x" 2x2 matrix. Also, it makes the calculation correct from "2x/n" to "x/2". Thank you.