scikit-adaptation / skada

Domain adaptation toolbox compatible with scikit-learn and pytorch
https://scikit-adaptation.github.io/
BSD 3-Clause "New" or "Revised" License
54 stars 16 forks source link

Custom_loss_function #162

Closed Som-III closed 6 days ago

Som-III commented 3 months ago

Changed metrics.py to add a new parameter 'criterion' within 'loss_function' with default as 'cross_entropy_loss' and can switch to 'BCELoss'

tgnassou commented 3 months ago

Hi @Som-III, thanks for participating in the Skada development!

Maybe I wasn't clear about my issue. You changed the cross-entropy loss in one of the DAscorers, but we want the cross entropy since we are following the paper.

My issue was more related to the functions of each Deep method like DANN. In these functions, the criterion is hardcoded as torch.nn.CrossEntropyLoss() what I want is to change that to have a criterion parameter with default value as torch.nn.CrossEntropyLoss(). Let me know if it is more precise and if you want to fix this issue :)