RMSprop Update
RMSprop
RMSprop adapts the learning rate for each parameter based on recent gradient magnitudes. Parameters with large gradients get smaller effective learning rates, and vice versa:
where:
Your task:
Implement rmsprop_update(weights, grad_sq, gradient, learning_rate, beta, epsilon). Return (weights_new, grad_sq_new).
Example Tests
Weights after update, cold start beta=0 (accessor [0])
Input: {"beta":0,"epsilon":0,"grad_sq":[0],"weights":[1],"gradient":[2],"learning_rate":0.1}
Expected: [0.9]
Weights: warm grad_sq normalizes step (accessor [0])
Input: {"beta":0,"epsilon":0,"grad_sq":[9],"weights":[0],"gradient":[3],"learning_rate":0.1}
Expected: [-0.1]
grad_sq_new accumulates (accessor [1])
Input: {"beta":0.9,"epsilon":0,"grad_sq":[0],"weights":[0],"gradient":[4],"learning_rate":0.1}
Expected: [1.6]