Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
OpenFold
Commits
5a004f04
"vscode:/vscode.git/clone" did not exist on "2082f213c214b8b9d15a92ac98ebe63e2dd6c99d"
Commit
5a004f04
authored
Oct 29, 2021
by
Marta
Browse files
zero out nan components in loss
parent
45a98436
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
0 deletions
+3
-0
openfold/utils/loss.py
openfold/utils/loss.py
+3
-0
No files found.
openfold/utils/loss.py
View file @
5a004f04
...
...
@@ -1473,6 +1473,9 @@ class AlphaFoldLoss(nn.Module):
weight
=
self
.
config
[
k
].
weight
if
weight
:
loss
=
loss_fn
()
if
(
torch
.
isnan
(
loss
)
or
torch
.
isinf
(
loss
)):
logging
.
warning
(
f
"
{
k
}
loss is NaN. Skipping example..."
)
loss
=
loss
.
new_tensor
(
0.
,
requires_grad
=
True
)
cum_loss
=
cum_loss
+
weight
*
loss
return
cum_loss
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment