Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implemented seed argument for reproducibility (redo) #71

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions config/inference/base.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@ inference:
align_motif: True
symmetric_self_cond: True
final_step: 1

# If deterministic == False, seed is ignored.
deterministic: False
seed: 0

trb_save_ckpt_path: null
schedule_directory_path: null
model_directory_path: null
Expand Down
4 changes: 2 additions & 2 deletions scripts/run_inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def make_deterministic(seed=0):
def main(conf: HydraConfig) -> None:
log = logging.getLogger(__name__)
if conf.inference.deterministic:
make_deterministic()
make_deterministic(conf.inference.seed)

# Check for available GPU and print result of check
if torch.cuda.is_available():
Expand Down Expand Up @@ -70,7 +70,7 @@ def main(conf: HydraConfig) -> None:

for i_des in range(design_startnum, design_startnum + sampler.inf_conf.num_designs):
if conf.inference.deterministic:
make_deterministic(i_des)
make_deterministic(conf.inference.seed + i_des)

start_time = time.time()
out_prefix = f"{sampler.inf_conf.output_prefix}_{i_des}"
Expand Down