-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix for NaN's when training DASM with ambiguous sequences #93
Conversation
@@ -195,11 +196,10 @@ def loss_of_batch(self, batch): | |||
# logit space, so we are set up for using the cross entropy loss. | |||
# However we have to mask out the sites that are not substituted, i.e. | |||
# the sites for which aa_subs_indicator is 0. | |||
subs_mask = aa_subs_indicator == 1 | |||
subs_mask = (aa_subs_indicator == 1) & mask |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is it, the whole Nan/inf fix! Could you have a look around here and make sure this looks reasonable to you, too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice sleuthing! It seems good to me... am I missing something?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think so, just wanted extra eyes on it! Thanks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome!
@@ -195,11 +196,10 @@ def loss_of_batch(self, batch): | |||
# logit space, so we are set up for using the cross entropy loss. | |||
# However we have to mask out the sites that are not substituted, i.e. | |||
# the sites for which aa_subs_indicator is 0. | |||
subs_mask = aa_subs_indicator == 1 | |||
subs_mask = (aa_subs_indicator == 1) & mask |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice sleuthing! It seems good to me... am I missing something?
The fix is one line, applying a mask that should have been applied from the very beginning, but previously didn't matter much since the data didn't contain ambiguities.
Also adds parallelized neutral model application, moved to the cpu. This makes running some notebooks much faster, and also speeds up setup for training Snakemake runs.