All problems
Natural Gradient Step
Problem
Perform one natural gradient descent step with a diagonal Fisher information matrix:
params_new[i] = params[i] - eta * gradient[i] / fisher_diag[i]
Return the updated parameter list.
Hint
Dividing by the Fisher information rescales steps by parameter uncertainty.
Test cases
case 1
in: [[0,0],[1,2],[1,1],0.1]
expected: [-0.1,-0.2]
case 2
in: [[1,-1],[0.5,-0.5],[2,2],0.5]
expected: [0.875,-0.875]
case 3
in: [[0],[1],[4],1]
expected: [-0.25]
case 4
in: [[2,3],[0,0],[1,1],0.1]
expected: [2,3]
Starter codePython
def natural_gradient_step(params, gradient, fisher_diag, eta):
# Your code here
pass4 test cases · run your code against them in the editor