We can't find the internet
Attempting to reconnect
Something went wrong!
Attempting to reconnect
← Optimizers from Scratch step 1 of 4
Easy
Primitives
Implement Gradient Descent Step
Implement a single step of vanilla gradient descent.
$$w_{t+1} = w_t - \eta \cdot \nabla w_t$$
Input:
-
weights: current parameter tensor -
gradients: gradient tensor (same shape as weights) -
lr: learning rate $\eta$
Output: Updated weights after one gradient descent step
Nothing accepted yet. When a submission passes, the code that passed shows up
here, one entry per mode.
Stuck?
PyTorch reference solution
Sign in to attempt this problem and reveal the reference solution.