Skip to content
DeepForgeby svx
All problems
EasyOptimizationop-102

Response Surface Steepest Path

Problem

Take a steepest-ascent step along the gradient direction.

Return step * grad / ||grad||. If the gradient is the zero vector, return a list of zeros with the same length.

Hint

Normalize the gradient before scaling by the path length.

Test cases

case 1
in: [[3,4],2]
expected: [1.2,1.6]
case 2
in: [[1,0,0],5]
expected: [5,0,0]
case 3
in: [[0,0],1]
expected: [0,0]
Starter codePython
def response_surface_steepest(grad, step):
    # Your code here
    pass

3 test cases · run your code against them in the editor