Skip to content
DeepForgeby svx
All problems

QMIX Monotonic Mix Check

Problem

Mix per-agent Q values with a QMIX mixing network and verify monotonicity.

Q_tot(s) = bias + sum_a agent_qs[s][a] * mixing_weights[a]. monotonic is True when raising any single agent's Q by 1 never decreases any Q_tot. Return [totals, monotonic].

Hint

Non-negative mixing weights guarantee that improving one agent never hurts the team.

Test cases

case 1
in: [[[1,2],[3,1]],[0.5,0.5],0]
expected: [[1.5,2],true]
case 2
in: [[[1,2]],[0.5,-0.5],0]
expected: [[-0.5],false]
case 3
in: [[[1,2],[3,1]],[0.25,0.75],1]
expected: [[2.75,2.5],true]
Starter codePython
def qmix_monotonic_mix(agent_qs, mixing_weights, bias):
    # Your code here
    pass

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