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
d65b76a2
Commit
d65b76a2
authored
Oct 20, 2021
by
Gustaf Ahdritz
Browse files
Fix inference-time bug in data pipeline, change config defaults
parent
13290527
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
12 deletions
+12
-12
openfold/config.py
openfold/config.py
+4
-4
openfold/data/input_pipeline.py
openfold/data/input_pipeline.py
+8
-8
No files found.
openfold/config.py
View file @
d65b76a2
...
@@ -50,7 +50,7 @@ def model_config(name, train=False, low_prec=False):
...
@@ -50,7 +50,7 @@ def model_config(name, train=False, low_prec=False):
c
.
globals
.
eps
=
1e-4
c
.
globals
.
eps
=
1e-4
# If we want exact numerical parity with the original, inf can't be
# If we want exact numerical parity with the original, inf can't be
# a global constant
# a global constant
set_inf
(
c
,
1e
5
)
set_inf
(
c
,
1e
4
)
return
c
return
c
...
@@ -185,7 +185,7 @@ config = mlc.ConfigDict(
...
@@ -185,7 +185,7 @@ config = mlc.ConfigDict(
"fixed_size"
:
True
,
"fixed_size"
:
True
,
"subsample_templates"
:
False
,
# We want top templates.
"subsample_templates"
:
False
,
# We want top templates.
"masked_msa_replace_fraction"
:
0.15
,
"masked_msa_replace_fraction"
:
0.15
,
"max_msa_clusters"
:
5
12
,
"max_msa_clusters"
:
12
8
,
"max_template_hits"
:
4
,
"max_template_hits"
:
4
,
"max_templates"
:
4
,
"max_templates"
:
4
,
"num_ensemble"
:
1
,
"num_ensemble"
:
1
,
...
@@ -197,7 +197,7 @@ config = mlc.ConfigDict(
...
@@ -197,7 +197,7 @@ config = mlc.ConfigDict(
"fixed_size"
:
True
,
"fixed_size"
:
True
,
"subsample_templates"
:
False
,
# We want top templates.
"subsample_templates"
:
False
,
# We want top templates.
"masked_msa_replace_fraction"
:
0.15
,
"masked_msa_replace_fraction"
:
0.15
,
"max_msa_clusters"
:
5
12
,
"max_msa_clusters"
:
12
8
,
"max_template_hits"
:
4
,
"max_template_hits"
:
4
,
"max_templates"
:
4
,
"max_templates"
:
4
,
"num_ensemble"
:
1
,
"num_ensemble"
:
1
,
...
@@ -209,7 +209,7 @@ config = mlc.ConfigDict(
...
@@ -209,7 +209,7 @@ config = mlc.ConfigDict(
"fixed_size"
:
True
,
"fixed_size"
:
True
,
"subsample_templates"
:
True
,
"subsample_templates"
:
True
,
"masked_msa_replace_fraction"
:
0.15
,
"masked_msa_replace_fraction"
:
0.15
,
"max_msa_clusters"
:
5
12
,
"max_msa_clusters"
:
12
8
,
"max_template_hits"
:
20
,
"max_template_hits"
:
20
,
"max_templates"
:
4
,
"max_templates"
:
4
,
"num_ensemble"
:
1
,
"num_ensemble"
:
1
,
...
...
openfold/data/input_pipeline.py
View file @
d65b76a2
...
@@ -156,19 +156,19 @@ def process_tensors_from_config(tensors, common_cfg, mode_cfg):
...
@@ -156,19 +156,19 @@ def process_tensors_from_config(tensors, common_cfg, mode_cfg):
tensors
=
compose
(
nonensembled_transform_fns
(
common_cfg
,
mode_cfg
))(
tensors
)
tensors
=
compose
(
nonensembled_transform_fns
(
common_cfg
,
mode_cfg
))(
tensors
)
num_ensemble
=
mode_cfg
.
num_ensemble
num_ensemble
=
mode_cfg
.
num_ensemble
num_recycling
=
int
(
tensors
[
"no_recycling_iters"
])
if
(
"no_recycling_iters"
in
tensors
):
num_recycling
=
int
(
tensors
[
"no_recycling_iters"
])
else
:
num_recycling
=
common_cfg
.
max_recycling_iters
if
common_cfg
.
resample_msa_in_recycling
:
if
common_cfg
.
resample_msa_in_recycling
:
# Separate batch per ensembling & recycling step.
# Separate batch per ensembling & recycling step.
num_ensemble
*=
num_recycling
+
1
num_ensemble
*=
num_recycling
+
1
if
isinstance
(
num_ensemble
,
torch
.
Tensor
)
or
num_ensemble
>
1
:
tensors
=
map_fn
(
tensors
=
map_fn
(
lambda
x
:
wrap_ensemble_fn
(
tensors
,
x
),
torch
.
arange
(
num_ensemble
)
lambda
x
:
wrap_ensemble_fn
(
tensors
,
x
),
torch
.
arange
(
num_ensemble
)
)
)
else
:
tensors_0
=
wrap_ensemble_fn
(
tensors
,
0
)
tensors
=
tree
.
map_structure
(
lambda
x
:
x
[
None
],
tensors_0
)
return
tensors
return
tensors
...
...
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