Open inkrement opened 4 years ago
I wanna apply focal loss to fasttext. But it seems this tool does not provide the corresponding interface. Could you tell me how to apply focal loss to fasttext? Thx!
@dongrixinyu Hi, good to hear that! You just have to fork/use my repository. There is already support for both the command line interface and python package! However, it is not really documented yet. Nevertheless, you can set the loss-argument to "focal" and you also have "beta" and "gamma" arguments.
@inkrement Hi, I find your repository is excellent! I have successfully applied focal loss to my model. However I am new to c++, and still have some questions:
Thx!!!
@dongrixinyu both questions are not really related to the focal loss per se. Therefore, I wrote you a PM.
@inkrement Thank you for your reply very much! I have read your email. I find a repository https://github.com/mwydmuch/extremeText。It provides l2 and sample weight params.
I just implemented prototypical focal loss support for Fasttext [1]. This loss is often used if your trainings set consists of many labels and/or is highly imbalanced [2]. For my purposes it works quite well, therefore, I wanted to ask if there is interest in greater support? If so, I could prepare a push request. However, this requires additional parameters and, in consequence, minor modifications to the used file-format.