All problems
Newton Decrement Value 2D
Problem
The Newton decrement squared is g^T H^{-1} g, a measure of proximity to the minimum; the decrement itself is half of it for the standard convention used here: 0.5 * g^T H^{-1} g.
Given the gradient and the inverse Hessian as nested rows, return the decrement value.
Hint
Compute H^{-1} g first, then take half the dot product with g.
Test cases
case 1
in: [[1,1],[[1,0],[0,1]]]
expected: 1
case 2
in: [[2,0],[[0.5,0],[0,0.5]]]
expected: 1
case 3
in: [[0,3],[[1,0],[0,1]]]
expected: 4.5
Starter codePython
def newton_decrement_value_2d(g, h_inv):
# Your code here
pass3 test cases · run your code against them in the editor