-
Notifications
You must be signed in to change notification settings - Fork 331
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DICE loss #296
Comments
Okayyy, someone pushed. I think this function should be available here. It's widely used. |
Interested |
@LukeWood If you want this please assign it to @gamenerd457 to port his PR here. |
Yea, I think we can host this here (adding this to keras repo might need more extended API review and requirement). We should put this to keras_cv/losses folder. |
@gamenerd457 Green light for a PR here. |
yeah seems like a great fit! |
So should I make a pr here |
If the loss easily confirms to the Keras loss API (y_true, y_pred) then yes! |
@LukeWood The intention was to port/refactoring @gamenerd457's Addons PR https://github.com/tensorflow/addons/pull/2558/files |
@gamenerd457 (cc. @bhack @LukeWood @qlzh727 )
Some refactoring may be needed, (i.e. subclassing the Also please follow the implementation details from segmentation_models/losses.py. This reference implementation offers some useful initial parameter (i.e def dice(y_true, y_pred, ...):
return loss
class Dice(keras.losses.Loss):
def __init__(self,
beta=1,
class_weights=None,
class_indexes=None,
per_image=False, smooth=SMOOTH, name='Dice'):
super().__init__(name=name)
def call(self, y_true, y_pred):
return dice(...) |
What are some use cases for per_image? Also note that in keras we won't support |
From HERE.
Enabling it to |
Cool, we will need to include this in the docstring. Seems like a match! |
Here are some info that might be helpful.
|
It is one of the most used loss functions in semantic segmentation tasks. Unfortunately still not available in
keras.loss.*
. It has been asked many times, #3611, #13085, #9395, #10890.(Not sure, if it's fit here or
keras.loss.*
)The text was updated successfully, but these errors were encountered: