Skip to content
DeepForgeby svx
All problems
EasyCalculusca-362

Maximum Directional Derivative Magnitude

Problem

The largest directional derivative of a differentiable function at a point equals the Euclidean norm of its gradient, attained in the gradient direction.

Given the gradient, return the maximum directional derivative.

Hint

It is the length of the gradient vector.

Test cases

case 1
in: [[3,4]]
expected: 5
case 2
in: [[1,0,0]]
expected: 1
case 3
in: [[0,-5,12]]
expected: 13
Starter codePython
def max_directional_derivative_magnitude(grad):
    # Your code here
    pass

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