A Keras usage pattern that allows for maximum flexibility when defining arbitrary losses and metrics (that don't match the usual signature) is the "endpoint layer" pattern. It works like this: https://t.co/dhYFKeemnC pic.twitter.com/v3YtMrrcQb
— François Chollet (@fchollet) May 14, 2019