All problems
ICM Forward Loss
Problem
Compute the ICM forward-model loss: one half of the mean squared error between predicted and actual next-state features. An empty vector returns 0.0.
Hint
The intrinsic reward is proportional to this forward prediction loss.
Test cases
case 1
in: [[0,0],[1,1]]
expected: 0.5
case 2
in: [[1,1],[1,1]]
expected: 0
case 3
in: [[2],[0]]
expected: 2
case 4
in: [[],[]]
expected: 0
Starter codePython
def icm_forward_loss(predicted_next, actual_next):
# Your code here
pass4 test cases · run your code against them in the editor