All problems
Superposition Interference
Problem
Measure interference in a feature dictionary. Given a (num_features, num_neurons) weight matrix W, compute the Gram matrix G = W W^T and return [max_abs_off_diagonal, mean_abs_off_diagonal] over the off-diagonal entries.
The signature is superposition_interference(W).
Hint
Features stored at an angle to each other interfere; orthogonal features do not.
Test cases
case 1
in: [[[1,0],[0,1]]]
expected: [0,0]
case 2
in: [[[1,1],[1,0]]]
expected: [1,1]
case 3
in: [[[1,0,0],[0.5,0.5,0],[0,0,1]]]
expected: [0.5,0.1666666667]
case 4
in: [[[1,2],[3,4],[5,6]]]
expected: [39,22.3333333333]
Starter codePython
def superposition_interference(W):
# Your code here
pass4 test cases · run your code against them in the editor