Skip to content
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

Focal Loss #319

Closed
sebastian-sz opened this issue Apr 14, 2022 · 10 comments · Fixed by #615
Closed

Focal Loss #319

sebastian-sz opened this issue Apr 14, 2022 · 10 comments · Fixed by #615

Comments

@sebastian-sz
Copy link
Contributor

Focal loss was used to train RetinaNet.

From Papers with code:

A Focal Loss function addresses class imbalance during training in tasks like object detection.

Reference Keras Implementation:
https://keras.io/examples/vision/retinanet/#implementing-smooth-l1-loss-and-focal-loss-as-keras-custom-losses

What do you think about this component? I think that maybe it could also benefit other models.

@innat
Copy link
Contributor

innat commented Apr 14, 2022

sigmoid focal loss : https://www.tensorflow.org/addons/api_docs/python/tfa/losses/SigmoidFocalCrossEntropy

@bhack
Copy link
Contributor

bhack commented Apr 14, 2022

@sebastian-sz
Copy link
Contributor Author

@bhack I understand that we would like to avoid duplication across repositories. I did not know there is an implementation already in Keras core (although it lacks the alpha parameter).

Should I close this issue?

@bhack
Copy link
Contributor

bhack commented Apr 14, 2022

@bhack I understand that we would like to avoid duplication across repositories. I did not know there is an implementation already in Keras core (although it lacks the alpha parameter).

Should I close this issue?

Personally I am ok to migrate things here.

@sebastian-sz
Copy link
Contributor Author

@bhack Ok thanks.

@bhack
Copy link
Contributor

bhack commented Apr 15, 2022

@sebastian-sz Honestly It was the scope of #74 to do this in an orderly manner but it seems that in the end it is quite recurrent to never manage this kind of things in a clean way.

@LukeWood
Copy link
Contributor

@bhack I understand that we would like to avoid duplication across repositories. I did not know there is an implementation already in Keras core (although it lacks the alpha parameter).

Should I close this issue?

No, this is a good issue to have open. TFA is not the same as the Keras API, even if some of the objects are in fact Keras Layer objects. TFA is a great place to look at reference implementations, but we should not expect users to install TFA to use KerasCV. Users should be able to coherently use KerasCV end to end using only KerasCV, Keras core, and TensorFlow core components (i.e. tf.data).

@quantumalaviya
Copy link
Contributor

@LukeWood I can work on this!

@SamuelMarks
Copy link
Contributor

@innat I just changed the docstring… @tanzhenyu did the rest I think

@quantumalaviya quantumalaviya mentioned this issue Jul 25, 2022
4 tasks
freedomtan pushed a commit to freedomtan/keras-cv that referenced this issue Jul 20, 2023
* Adds Timeseries Transformer

* Add Colaborative filtering example
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants