Hi Daniel,
I have a silly question. Could you not simply change the sign of the ‘adversarial’ loss term (the one resulting from the purple blocks in the model) and bypass the need to implement custom layers?