You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The PyTorch nn.MSELoss is not able to handle ignored indices (like the nn.CrossEntropyLoss).
A solution provided by @mheinzinger would be as follows:
You could easily implement this by yourself by passing "reduce=None" when initializing your loss function. As a result it will return a loss for each residue in your input instead of a single scalar. Then you can manually multiply the masked elements by 0 and average. When averaging, divide only by the number of non-masked residues.
This must be kept in mind for implementing residue(s)_to_value protocols in the future.
The text was updated successfully, but these errors were encountered:
The PyTorch nn.MSELoss is not able to handle ignored indices (like the nn.CrossEntropyLoss).
A solution provided by @mheinzinger would be as follows:
This must be kept in mind for implementing residue(s)_to_value protocols in the future.
The text was updated successfully, but these errors were encountered: