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
80b32a3a
"tools/git@developer.sourcefind.cn:OpenDAS/openpcdet.git" did not exist on "6f80c436769a40c80ba1e9d7bfe7397015bbbcf0"
Commit
80b32a3a
authored
Jun 29, 2023
by
Geoffrey Yu
Browse files
update greedy_align just in case there are nan in rmsd calculation
parent
80f0d617
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
9 deletions
+14
-9
openfold/utils/loss.py
openfold/utils/loss.py
+14
-9
No files found.
openfold/utils/loss.py
View file @
80b32a3a
...
@@ -1855,15 +1855,17 @@ def greedy_align(
...
@@ -1855,15 +1855,17 @@ def greedy_align(
continue
continue
j
=
int
(
next_asym_id
-
1
)
j
=
int
(
next_asym_id
-
1
)
if
not
used
[
j
]:
# possible candidate
if
not
used
[
j
]:
# possible candidate
cropped_pos
=
true_ca_poses
[
j
]
while
best_idx
is
None
:
mask
=
true_ca_masks
[
j
][
cur_residue_index
]
cropped_pos
=
true_ca_poses
[
j
]
rmsd
=
compute_rmsd
(
mask
=
true_ca_masks
[
j
][
cur_residue_index
]
cropped_pos
,
cur_pred_pos
,
(
cur_pred_mask
.
to
(
'cuda:0'
)
*
mask
.
to
(
'cuda:0'
)).
bool
()
rmsd
=
compute_rmsd
(
)
cropped_pos
,
cur_pred_pos
,
(
cur_pred_mask
.
to
(
'cuda:0'
)
*
mask
.
to
(
'cuda:0'
)).
bool
()
print
(
f
"rmsd is
{
rmsd
}
"
)
)
if
rmsd
<
best_rmsd
:
best_rmsd
=
rmsd
if
(
rmsd
is
not
None
)
and
(
rmsd
<
best_rmsd
):
best_idx
=
j
best_rmsd
=
rmsd
best_idx
=
j
print
(
f
"now best_idx is
{
best_idx
}
and rmsd is
{
rmsd
}
and j is
{
j
}
"
)
assert
best_idx
is
not
None
assert
best_idx
is
not
None
used
[
best_idx
]
=
True
used
[
best_idx
]
=
True
align
.
append
((
i
,
best_idx
))
align
.
append
((
i
,
best_idx
))
...
@@ -2117,7 +2119,10 @@ class AlphaFoldMultimerLoss(AlphaFoldLoss):
...
@@ -2117,7 +2119,10 @@ class AlphaFoldMultimerLoss(AlphaFoldLoss):
move_to_gpu
=
lambda
t
:
(
t
.
to
(
'cuda:0'
))
move_to_gpu
=
lambda
t
:
(
t
.
to
(
'cuda:0'
))
features
=
tensor_tree_map
(
move_to_gpu
,
features
)
features
=
tensor_tree_map
(
move_to_gpu
,
features
)
print
(
f
"after moving features:"
,
torch
.
cuda
.
memory_allocated
(
0
))
print
(
f
"after moving features:"
,
torch
.
cuda
.
memory_allocated
(
0
))
print
(
f
"features is
{
type
(
features
)
}
and out is
{
type
(
out
)
}
"
)
# out = tensor_tree_map(move_to_gpu,out)
# out = tensor_tree_map(move_to_gpu,out)
for
k
,
v
in
out
.
items
():
out
[
k
]
=
v
.
to
(
'cuda'
)
self
.
loss
(
out
,
features
)
self
.
loss
(
out
,
features
)
return
permutated_labels
return
permutated_labels
## TODO next need to check how the ground truth label is used
## TODO next need to check how the ground truth label is used
...
...
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