Skip to content

Custom Loss function #396

Oct 7, 2021 · 1 comments · 2 replies
Discussion options

You must be logged in to vote

Hi @nishai,

Thank you for documenting your issue so nicely!
I think you are assessing the situation right.
You seem to be doing everything correct, but our docstring is different from the actual check.
-> we should relax the check to allow for any loss_func being a subclass of _Loss, not just ones predefined in Torch.

We have one test for a callable function as loss:

def test_callable_loss(self):

However, we currently do not have a test covering your case.

I would appreciate if you could open a pull request with:

  1. Fix the issue by changing the check as described
  2. Contribute your two types of defining it as a two…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@nishai
Comment options

@ourownstory
Comment options

Answer selected by nishai
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants