Skip to content
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
7 changes: 7 additions & 0 deletions scripts/config/inference/antibody.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,10 @@ antibody:
terminate_bad_targeting: null
hotspot_termination_threshold: 10
hotspot_termination_failures_permitted: 20

hydra:
run:
dir: ${oc.env:HOME}/.rfantibody/outputs/${now:%Y-%m-%d}/${now:%H-%M-%S}
sweep:
dir: ${oc.env:HOME}/.rfantibody/multirun/${now:%Y-%m-%d}/${now:%H-%M-%S}
subdir: ${hydra.job.num}
7 changes: 7 additions & 0 deletions scripts/config/inference/base.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -168,3 +168,10 @@ scaffoldguided:
target_ss: null
target_adj: null
mask_loops: True

hydra:
run:
dir: ${oc.env:HOME}/.rfantibody/outputs/${now:%Y-%m-%d}/${now:%H-%M-%S}
sweep:
dir: ${oc.env:HOME}/.rfantibody/multirun/${now:%Y-%m-%d}/${now:%H-%M-%S}
subdir: ${hydra.job.num}
6 changes: 6 additions & 0 deletions src/rfantibody/rf2/config/base.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,9 @@ model_param:
div: 4
n_heads: 4

hydra:
run:
dir: ${oc.env:HOME}/.rfantibody/outputs/${now:%Y-%m-%d}/${now:%H-%M-%S}
sweep:
dir: ${oc.env:HOME}/.rfantibody/multirun/${now:%Y-%m-%d}/${now:%H-%M-%S}
subdir: ${hydra.job.num}
11 changes: 7 additions & 4 deletions src/rfantibody/rfdiffusion/diffusion.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# script for diffusion protocols
import logging
import os
from pathlib import Path
import pickle
import time
from typing import List
Expand Down Expand Up @@ -49,8 +50,10 @@ def get_chi_betaT(max_timestep=100, beta_0=0.01, abar_T=1e-3, method='cosine'):
Function to precalculate beta_T for chi angles (decoded at different time steps, so T in beta_T varies).
Calculated empirically
"""
cache_dir=os.path.join(Path.home(), '.rfantibody', 'cached_schedules')
name = f'T{max_timestep}_beta_0{beta_0}_abar_T{abar_T}_method_{method}.pkl'
name=os.path.join(cache_dir, name)

name = f'./cached_schedules/T{max_timestep}_beta_0{beta_0}_abar_T{abar_T}_method_{method}.pkl'

if not os.path.exists(name):
print('Calculating chi_beta_T dictionary...')
Expand All @@ -72,8 +75,8 @@ def get_chi_betaT(max_timestep=100, beta_0=0.01, abar_T=1e-3, method='cosine'):
beta_Ts[timestep] = idx.item()

# save cached schedule
if not os.path.isdir('./cached_schedules/'):
os.makedirs('./cached_schedules/', exist_ok=True)
if not os.path.isdir(cache_dir):
os.makedirs(cache_dir, exist_ok=True)
with open(name, 'wb') as fp:
pickle.dump(beta_Ts, fp)

Expand Down Expand Up @@ -880,7 +883,7 @@ def __init__(self,
schedule_kwargs={},
chi_kwargs={},
var_scale=1.0,
cache_dir='.',
cache_dir=os.path.join(Path.home(), '.rfantibody', 'cached_schedules'),
partial_T=None,
truncation_level=2000
):
Expand Down