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
43941b82
Commit
43941b82
authored
Sep 30, 2022
by
Arkadiusz Nowaczynski
Browse files
Set clamped vs unclamped FAPE for each sample in batch independently
parent
a1f77ad0
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
5 deletions
+15
-5
openfold/data/data_modules.py
openfold/data/data_modules.py
+0
-5
openfold/data/feature_pipeline.py
openfold/data/feature_pipeline.py
+15
-0
No files found.
openfold/data/data_modules.py
View file @
43941b82
...
...
@@ -440,11 +440,6 @@ class OpenFoldDataLoader(torch.utils.data.DataLoader):
stage_cfg
=
self
.
config
[
self
.
stage
]
max_iters
=
self
.
config
.
common
.
max_recycling_iters
if
(
stage_cfg
.
supervised
):
clamp_prob
=
self
.
config
.
supervised
.
clamp_prob
keyed_probs
.
append
(
(
"use_clamped_fape"
,
[
1
-
clamp_prob
,
clamp_prob
])
)
if
(
stage_cfg
.
uniform_recycling
):
recycling_probs
=
[
...
...
openfold/data/feature_pipeline.py
View file @
43941b82
...
...
@@ -94,6 +94,21 @@ def np_example_to_features(
cfg
[
mode
],
)
if
mode
==
"train"
:
p
=
torch
.
rand
(
1
).
item
()
use_clamped_fape_value
=
float
(
p
<
cfg
.
supervised
.
clamp_prob
)
features
[
"use_clamped_fape"
]
=
torch
.
full
(
size
=
[
cfg
.
common
.
max_recycling_iters
+
1
],
fill_value
=
use_clamped_fape_value
,
dtype
=
torch
.
float32
,
)
else
:
features
[
"use_clamped_fape"
]
=
torch
.
full
(
size
=
[
cfg
.
common
.
max_recycling_iters
+
1
],
fill_value
=
0.0
,
dtype
=
torch
.
float32
,
)
return
{
k
:
v
for
k
,
v
in
features
.
items
()}
...
...
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