A mixing desk works like one layer of a network: each speaker plays every track through its own knob and adds them up, speaker[i] = knob[i][0] * x[0] + knob[i][1] * x[1] + knob[i][2] * x[2]. You know each track’s level, x, and how far off each speaker came out, err: its loudness minus what it should be, so too loud is positive. That’s also how fast the loss grows as that speaker gets louder. Write weight_grad(x, err): each knob’s blame, how much the loss grows per unit you turn that knob up, laid out like the knobs: one row per speaker, one column per track.
A mixing desk at a sound check: every track reaches every speaker through its own knob. The speakers come out too loud, and the desk has to learn which knobs to turn. The goal is a blame for each knob, like the one it ends on. Your weight_grad(x, err) works it out from the tracks’ levels and the speakers’ errors.
weight_grad(x, err)| x | each track's level, [drums, bass, vocals] (a numpy array) | e.g. [1, 0, 0] |
| err | how far off each speaker is, [left, right] (a numpy array): its loudness minus what it should be (too loud is positive), also how fast the loss grows as it gets louder | e.g. [1, 1] |
| returns | each knob's blame, how much the loss grows per unit you turn it up: | |