Skip to main content

For Checking Neural Network Projects, you can check neural network classification systems - 2 Projects

1. PyTorch Intro

Pytorch saves time because it keeps the parent function in memory so we dont have to manually use derivatives and chain rule So instead of manually writing:

dL_dy = -2 * (target - y)
dL_dw_output = dL_dy * a
dL_db_output = dL_dy
dL_da = dL_dy * w_output

you simply do:

loss.backward()

Then Pytorch stores the gradients here:

W.grad
b_hidden.grad
w_output.grad
b_output.grad

Uptating using gredients​

with torch.no_grad():
        W -= learning_rate * W.grad