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
e097da95
Commit
e097da95
authored
Sep 06, 2023
by
Geoffrey Yu
Browse files
check if it's a monomer first; add permutate_chains back to forward()
parent
cec5a426
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
15 deletions
+19
-15
openfold/utils/loss.py
openfold/utils/loss.py
+19
-15
No files found.
openfold/utils/loss.py
View file @
e097da95
...
...
@@ -2146,7 +2146,7 @@ class AlphaFoldMultimerLoss(AlphaFoldLoss):
return
align
,
per_asym_residue_index
def
forward
(
self
,
out
,
features
,
_return_breakdown
=
False
):
def
forward
(
self
,
out
,
features
,
_return_breakdown
=
False
,
permutate_chains
=
True
):
"""
Overwrite AlphaFoldLoss forward function so that
it first compute multi-chain permutation
...
...
@@ -2155,6 +2155,10 @@ class AlphaFoldMultimerLoss(AlphaFoldLoss):
out: the output of model.forward()
batch: a pair of input features and its corresponding ground truth structure
"""
# first check if it is a monomer
is_monomer
=
len
(
torch
.
unique
(
features
[
'asym_id'
]))
==
1
or
torch
.
unique
(
features
[
'asym_id'
]).
tolist
()
==
[
0
,
1
]
if
not
is_monomer
:
permutate_chains
=
True
# first determin which dimension in the tensor to split into individual ground truth labels
dim_dict
=
AlphaFoldMultimerLoss
.
determine_split_dim
(
features
)
...
...
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