x = np.random.random((1, 4))
y = np.array([[1, -1, 0]])
output = model.predict(x)
print(output)
print(model.evaluate(x, y))
print((output[0, 0] - 1) ** 2 + 0 + (output[0, 2] - 0) ** 2)
Customize Keras' loss function in a way that the y_true will depend on y_pred