mlverse / torch

R Interface to Torch
https://torch.mlverse.org
Other
483 stars 66 forks source link

nn_cross_entropy_loss (ignore_index = 0) #1145

Open AGPatriota opened 3 months ago

AGPatriota commented 3 months ago

Dear fellows

I was trying to ignore the first index in the cross_entropy_loss, but the index is following the Python pattern.

It ignores the second index: nn_cross_entropy_loss(ignore_index=1)

It ignores the first index: nn_cross_entropy_loss(ignore_index=0)

That might happen for other functions, see my opened issue.

Best