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

Introduction to neural networks: 35. Notebook: Analyzing Student Data: error_term_formula solution #409

Open scmanjarrez opened 1 year ago

scmanjarrez commented 1 year ago

Why you multiply the sigmoid_prime(x) by x? You defined backpropagation error as (𝑦−𝑦̂)𝜎′(𝑥) in the notebook: Your solution:

def error_term_formula(x, y, output):
#    for binary cross entropy loss
    return (y - output)*x
#    for mean square error
#    return (y - output)*sigmoid_prime(x)*x

Notebook definition:

TODO: Backpropagate the error

Now it's your turn to shine. Write the error term. Remember that this is given by the equation
(𝑦−𝑦̂)𝜎′(𝑥)

You even had (y - output)*sigmoid_prime(x) as the solution, but then you changed it to (y - output)*sigmoid_prime(x)*x in this commit