Second post in my series of advanced Keras tutorials: on constructing complex custom losses and metrics, published on TowardsDataScience.com. In this tutorial I cover a simple trick that will allow you to construct custom loss functions in Keras which can receive arguments other than y_true and y_pred.