Skip to content
DeepForgeby svx
All problems
HardInformation Theoryinfo-246

DCI Disentanglement

Problem

Return the DCI disentanglement score of an importance matrix. Rows are ground-truth factors and columns are learned generators. For each factor, normalize its row into a distribution over generators, take the Shannon entropy in bits, then return

1 - mean(entropy) / log2(num_generators)

A score of 1 means every factor is controlled by a single generator.

Hint

Entangled factors spread their importance across several generators.

Test cases

case 1
in: [[[1,0],[0,1]]]
expected: 1
case 2
in: [[[1,1],[1,1]]]
expected: 0
case 3
in: [[[1,0,0],[0,1,0],[0,0,1]]]
expected: 1
case 4
in: [[[1,0,0],[0,2,0],[1,1,0]]]
expected: 0.7896900821428475
Starter codePython
import math
def dci_disentanglement(importance):
    # Your code here
    pass

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