Skip to content
Discussion options

You must be logged in to vote

You would probably want to give this invalid regression values a float('NaN') when creating your tensor. Afterwards, I think your training loss function looks as

loss1 = F.binary_cross_entropy(...)
mask = y == 1
loss2 = F.mse_loss(out_reg[mask], y_reg[mask])

Thus, avoiding making use of NaN ground-truth values during training.

Replies: 1 comment 2 replies

Comment options

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

@rusty1s
Comment options

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