How to Use Custom Losses with Custom Gradients in TensorFlow with Keras