I am using a custom loss to train my model and want to use feature value to have a differential loss, something like
def custom_loss(y_true, y_pred, feature_val):
return (feature_val ** 2) * abs(y_true - y_pred)
How can I achieve this in Keras?