How to pass a custom mask to my loss function? #562
Unanswered
intercodesys
asked this question in
Q&A
Replies: 1 comment 2 replies
-
I'd have a look at how it is done in the implementation of the Masked Value
Predictor callback.
…On Fri, Aug 19, 2022, 21:59 intercodesys ***@***.***> wrote:
I want to be able to use a mask in my loss function, so it focus on
specific items more than others. I tried to define the mask and pass it to
the loss function: loss_func = partial(my_loss, mask) which obviously does
not work because the dataloader shuffles the items in every batch.
So my question is how do I do this? Can I pass the mask to the dataloader
somehow and retrieve it from the loss function? Or can I get the shuffled
indices of the current batch from within the loss function?
Thanks!
—
Reply to this email directly, view it on GitHub
<#562>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABWBN2C5ZOFVMH2FNDDTWIDVZ7RRLANCNFSM57BZ3A5Q>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I want to be able to use a mask in my loss function, so it focus on specific items more than others. I tried to define the mask and pass it to the loss function: loss_func = partial(my_loss, mask) which obviously does not work because the dataloader shuffles the items in every batch.
So my question is how do I do this? Can I pass the mask to the dataloader somehow and retrieve it from the loss function? Or can I get the shuffled indices of the current batch from within the loss function?
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions