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
2a70e080
Commit
2a70e080
authored
Jun 26, 2023
by
Geoffrey Yu
Browse files
handel NaN and Inf in test output to avoid crashes
parent
458a62f7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
openfold/utils/loss.py
openfold/utils/loss.py
+2
-2
No files found.
openfold/utils/loss.py
View file @
2a70e080
...
@@ -1722,7 +1722,7 @@ def get_optimal_transform(
...
@@ -1722,7 +1722,7 @@ def get_optimal_transform(
#
#
# sometimes using fake test inputs generates NaN in the predicted atom positions
# sometimes using fake test inputs generates NaN in the predicted atom positions
# #
# #
src_atoms
=
torch
.
nan_to_num
(
src_atoms
,
nan
=
0.0
)
src_atoms
=
torch
.
nan_to_num
(
src_atoms
,
nan
=
0.0
,
posinf
=
1.0
,
neginf
=
1.0
)
if
mask
is
not
None
:
if
mask
is
not
None
:
assert
mask
.
dtype
==
torch
.
bool
assert
mask
.
dtype
==
torch
.
bool
...
@@ -1836,7 +1836,7 @@ def greedy_align(
...
@@ -1836,7 +1836,7 @@ def greedy_align(
cur_asym_list
=
entity_2_asym_list
[
int
(
cur_entity_ids
)]
cur_asym_list
=
entity_2_asym_list
[
int
(
cur_entity_ids
)]
cur_residue_index
=
per_asym_residue_index
[
int
(
cur_asym_id
)]
cur_residue_index
=
per_asym_residue_index
[
int
(
cur_asym_id
)]
cur_pred_pos
=
pred_ca_pos
[
asym_mask
]
# only need the first 1 column of asym_mask
cur_pred_pos
=
pred_ca_pos
[
asym_mask
]
cur_pred_mask
=
pred_ca_mask
[
asym_mask
]
cur_pred_mask
=
pred_ca_mask
[
asym_mask
]
for
next_asym_id
in
cur_asym_list
:
for
next_asym_id
in
cur_asym_list
:
if
next_asym_id
==
0
:
if
next_asym_id
==
0
:
...
...
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