Snowflake-inspired ML platform team is validating a small optimizer implementation before using it inside a larger training workflow. You need to compute one exact SGD parameter update from the current parameters, learning rate, and gradients.
Compute one gradient-descent step: θ←θ−ηg.
Implement solve(theta,grad,lr).
Returns. Return a NumPy array with the updated parameters; the inputs are not modified.
Example 1
Input:
solve([1, 2], [0.5, -1], 0.1)
Output:
[0.95, 2.1]
Example 2
Input:
solve([0.0], [10.0], 0.01)
Output:
[-0.1]
No results yet
Run your code to check it against the examples, or submit to run every test.