Define error as:
Then:
And weights are updated a small amount in the opposite direction of the gradient: