I am writing a keras custom loss function where in I want to pass to this function the following: y_true, y_pred (these two will be passed automatically anyway), weights of
You can do this another way by using the lambda operator as following:
model.compile(loss= [lambda y_true,y_pred: Custom_loss(y_true, y_pred, val=0.01)], optimizer =...)
There are some issues regarding saving and loading the model this way. A workaround is to save only the weights and use model.load_weights(...)