code stringlengths 17 6.64M |
|---|
def precompute_alignments(tags, seqs, alignment_dir, args):
for (tag, seq) in zip(tags, seqs):
tmp_fasta_path = os.path.join(args.output_dir, f'tmp_{os.getpid()}.fasta')
with open(tmp_fasta_path, 'w') as fp:
fp.write(f'''>{tag}
{seq}''')
local_alignment_dir = os.path.join(align... |
def round_up_seqlen(seqlen):
return (int(math.ceil((seqlen / TRACING_INTERVAL))) * TRACING_INTERVAL)
|
def generate_feature_dict(tags, seqs, alignment_dir, data_processor, args):
tmp_fasta_path = os.path.join(args.output_dir, f'tmp_{os.getpid()}.fasta')
if (len(seqs) == 1):
tag = tags[0]
seq = seqs[0]
with open(tmp_fasta_path, 'w') as fp:
fp.write(f'''>{tag}
{seq}''')
... |
def list_files_with_extensions(dir, extensions):
return [f for f in os.listdir(dir) if f.endswith(extensions)]
|
def main(args):
os.makedirs(args.output_dir, exist_ok=True)
config = model_config(args.config_preset, long_sequence_inference=args.long_sequence_inference)
if args.trace_model:
if (not config.data.predict.fixed_size):
raise ValueError('Tracing requires that fixed_size mode be enabled i... |
def main(args):
db_path = os.path.join(args.output_db_path, f'{args.output_db_name}.db')
index_path = os.path.join(args.output_db_path, f'{args.output_db_name}.index')
db_fp = open(db_path, 'wb')
index = {}
db_offset = 0
for chain_alignment_dir in os.listdir(args.alignment_dir):
cad_pa... |
def main(args):
super_index = {}
for f in os.listdir(args.alignment_db_dir):
if (not (os.path.splitext(f)[(- 1)] == '.index')):
continue
with open(os.path.join(args.alignment_db_dir, f), 'r') as fp:
index = json.load(fp)
db_name = f'{os.path.splitext(f)[0]}.db'
... |
def reshape_fn(of_param, af_weight):
transformations = {ParamType.LinearWeight: (lambda w: w.transpose((- 1), (- 2))), ParamType.LinearWeightMHA: (lambda w: w.transpose((- 1), (- 2)).reshape(af_weight.shape)), ParamType.LinearMHAOutputWeight: (lambda w: w.transpose((- 1), (- 2)).reshape(af_weight.shape)), ParamTy... |
def transfer(of_dict, af_weight_template):
for k in of_dict:
if (type(of_dict[k]) == dict):
transfer(of_dict[k], af_weight_template[k])
else:
reshaped = reshape_fn(of_dict[k], af_weight_template[k])
reshaped = reshaped.detach().numpy()
np.copyto(af_w... |
def main(args):
d = torch.load(args.of_pt_path)
config = model_config(args.config_preset)
model = AlphaFold(config)
model.load_state_dict(d)
translation = generate_translation_dict(model, args.config_preset)
translation = process_translation_dict(translation)
af_weight_template = np.load(a... |
def main(args):
fasta = []
for fname in os.listdir(args.data_dir):
(basename, ext) = os.path.splitext(fname)
basename = basename.upper()
fpath = os.path.join(args.data_dir, fname)
if (ext == '.cif'):
with open(fpath, 'r') as fp:
mmcif_str = fp.read()... |
def generate_url(period, end_date):
return '/'.join(['https://www.cameo3d.org/', 'modeling', 'targets', period, 'ajax', f'?to_date={end_date}'])
|
def main(args):
data_dir_path = os.path.join(args.output_dir, 'data_dir')
fasta_dir_path = os.path.join(args.output_dir, 'fasta_dir')
os.makedirs(data_dir_path, exist_ok=True)
os.makedirs(fasta_dir_path, exist_ok=True)
url = generate_url(args.period, args.end_date)
raw_data = requests.get(url)... |
def main(args):
template_featurizer = templates.TemplateHitFeaturizer(mmcif_dir=args.mmcif_dir, max_template_date=args.max_template_date, max_hits=20, kalign_binary_path=args.kalign_binary_path, release_dates_path=None, obsolete_pdbs_path=args.obsolete_pdbs_path)
data_pipeline = pipeline.DataPipeline(jackhmme... |
def parse_file(f, args, chain_cluster_size_dict):
(file_id, ext) = os.path.splitext(f)
if (ext == '.cif'):
with open(os.path.join(args.data_dir, f), 'r') as fp:
mmcif_string = fp.read()
mmcif = parse(file_id=file_id, mmcif_string=mmcif_string)
if (mmcif.mmcif_object is None... |
def main(args):
chain_cluster_size_dict = None
if (args.cluster_file is not None):
chain_cluster_size_dict = {}
with open(args.cluster_file, 'r') as fp:
clusters = [l.strip() for l in fp.readlines()]
for cluster in clusters:
chain_ids = cluster.split()
... |
def parse_file(f, args):
with open(os.path.join(args.mmcif_dir, f), 'r') as fp:
mmcif_string = fp.read()
file_id = os.path.splitext(f)[0]
mmcif = parse(file_id=file_id, mmcif_string=mmcif_string)
if (mmcif.mmcif_object is None):
logging.info(f'Could not parse {f}. Skipping...')
... |
def main(args):
files = [f for f in os.listdir(args.mmcif_dir) if ('.cif' in f)]
fn = partial(parse_file, args=args)
data = {}
with Pool(processes=args.no_workers) as p:
with tqdm(total=len(files)) as pbar:
for d in p.imap_unordered(fn, files, chunksize=args.chunksize):
... |
def run_seq_group_alignments(seq_groups, alignment_runner, args):
dirs = set(os.listdir(args.output_dir))
for (seq, names) in seq_groups:
first_name = names[0]
alignment_dir = os.path.join(args.output_dir, first_name)
try:
os.makedirs(alignment_dir)
except Exception... |
def parse_and_align(files, alignment_runner, args):
for f in files:
path = os.path.join(args.input_dir, f)
file_id = os.path.splitext(f)[0]
seq_group_dict = {}
if f.endswith('.cif'):
with open(path, 'r') as fp:
mmcif_str = fp.read()
mmcif = m... |
def main(args):
alignment_runner = AlignmentRunner(jackhmmer_binary_path=args.jackhmmer_binary_path, hhblits_binary_path=args.hhblits_binary_path, hhsearch_binary_path=args.hhsearch_binary_path, uniref90_database_path=args.uniref90_database_path, mgnify_database_path=args.mgnify_database_path, bfd_database_path=a... |
def _split_a3ms(output_dir):
for fname in os.listdir(output_dir):
if (not (os.path.splitext(fname)[(- 1)] == '.a3m')):
continue
fpath = os.path.join(output_dir, fname)
with open(fpath, 'r') as fp:
a3ms = fp.read()
a3ms = a3ms.split('\x00')[:(- 1)]
fo... |
def main(args):
with open(args.input_fasta, 'r') as f:
lines = [l.strip() for l in f.readlines()]
names = lines[::2]
seqs = lines[1::2]
if (args.fasta_chunk_size is None):
chunk_size = len(seqs)
else:
chunk_size = args.fasta_chunk_size
Path(args.output_dir).mkdir(parent... |
def main(args):
count = 0
max_count = (args.max_count if (args.max_count is not None) else (- 1))
msas = sorted((f for f in os.listdir(args.msa_dir)))
mmcifs = sorted((f for f in os.listdir(args.mmcif_dir)))
mmcif_idx = 0
for f in msas:
if (count == max_count):
break
... |
def _write_file(args, file_in_progress):
file_id = file_in_progress[1]
fname = (file_id.upper() + '.core')
fpath = os.path.join(args.output_dir, fname)
with open(fpath, 'w') as fp:
fp.write('\n'.join(file_in_progress))
|
def main(args):
Path(args.output_dir).mkdir(parents=True, exist_ok=True)
with open(args.proteinnet_file, 'r') as fp:
proteinnet_string = fp.readlines()
file_in_progress = []
for line in proteinnet_string:
if (line == '[ID]\n'):
if (len(file_in_progress) > 0):
... |
def add_data_args(parser: argparse.ArgumentParser):
parser.add_argument('--uniref90_database_path', type=str, default=None)
parser.add_argument('--mgnify_database_path', type=str, default=None)
parser.add_argument('--pdb70_database_path', type=str, default=None)
parser.add_argument('--uniclust30_datab... |
def get_nvidia_cc():
'\n Returns a tuple containing the Compute Capability of the first GPU\n installed in the system (formatted as a tuple of strings) and an error\n message. When the former is provided, the latter is None, and vice versa.\n\n Adapted from script by Jan Schlüte t\n https://gist.gi... |
def get_model_state_file(checkpoint_dir, zero_stage):
if (not os.path.isdir(checkpoint_dir)):
raise FileNotFoundError(f"Directory '{checkpoint_dir}' doesn't exist")
if (zero_stage == 2):
file = os.path.join(checkpoint_dir, 'mp_rank_00_model_states.pt')
elif (zero_stage == 3):
file ... |
def get_optim_files(checkpoint_dir):
optim_files = sorted(glob.glob(os.path.join(checkpoint_dir, '*_optim_states.pt')))
if (len(optim_files) == 0):
raise FileNotFoundError(f"can't find '*_optim_states.pt' files in directory '{checkpoint_dir}'")
return optim_files
|
def parse_model_state(file):
state_dict = torch.load(file, map_location=device)
if ('buffer_names' not in state_dict):
raise ValueError(f'{file} is not a model state checkpoint')
buffer_names = state_dict['buffer_names']
if debug:
print('Found buffers:', buffer_names)
buffers = {k:... |
def parse_optim_states(files, ds_checkpoint_dir):
total_files = len(files)
state_dicts = []
for f in files:
state_dicts.append(torch.load(f, map_location=device))
if (not ('zero_stage' in state_dicts[0]['optimizer_state_dict'])):
raise ValueError(f'{files[0]} is not a zero checkpoint')... |
def _get_fp32_state_dict_from_zero_checkpoint(ds_checkpoint_dir):
'\n Returns fp32 state_dict reconstructed from ds checkpoint\n\n Args:\n - ``ds_checkpoint_dir``: path to the deepspeed checkpoint folder (where the optimizer files are)\n\n '
print(f"Processing zero checkpoint '{ds_checkpoint_d... |
def _get_fp32_state_dict_from_zero2_checkpoint(world_size, param_shapes, fp32_flat_groups, buffers):
if debug:
for i in range(world_size):
for j in range(len(fp32_flat_groups[0])):
print(f'fp32_flat_groups[{i}][{j}].shape={fp32_flat_groups[i][j].shape}')
num_param_groups = ... |
def zero3_partitioned_param_info(unpartitioned_numel, world_size):
remainder = (unpartitioned_numel % world_size)
padding_numel = ((world_size - remainder) if remainder else 0)
partitioned_numel = math.ceil((unpartitioned_numel / world_size))
return (partitioned_numel, padding_numel)
|
def _get_fp32_state_dict_from_zero3_checkpoint(world_size, param_shapes, fp32_flat_groups, buffers):
avail_numel = (fp32_flat_groups[0].numel() * world_size)
param_shapes = {k: v for d in param_shapes for (k, v) in d.items()}
if debug:
for i in range(world_size):
print(f'fp32_flat_grou... |
def get_fp32_state_dict_from_zero_checkpoint(checkpoint_dir, tag=None):
"\n Convert ZeRO 2 or 3 checkpoint into a single fp32 consolidated state_dict that can be loaded with\n ``load_state_dict()`` and used for training without DeepSpeed or shared with others, for example\n via a model hub.\n\n Args:\... |
def convert_zero_checkpoint_to_fp32_state_dict(checkpoint_dir, output_file, tag=None):
'\n Convert ZeRO 2 or 3 checkpoint into a single fp32 consolidated ``state_dict`` file that can be\n loaded with ``torch.load(file)`` + ``load_state_dict()`` and used for training without DeepSpeed.\n\n Args:\n ... |
def load_state_dict_from_zero_checkpoint(model, checkpoint_dir, tag=None):
"\n 1. Put the provided model to cpu\n 2. Convert ZeRO 2 or 3 checkpoint into a single fp32 consolidated ``state_dict``\n 3. Load it into the provided model\n\n Args:\n - ``model``: the model object to update\n - ... |
def get_global_step_from_zero_checkpoint(checkpoint_dir):
global_step = (- 1)
latest_path = os.path.join(checkpoint_dir, 'latest')
if os.path.isfile(latest_path):
with open(latest_path, 'r') as fd:
tag = fd.read().strip()
match = re.match('global_step([0-9]+)', tag)
... |
def get_cuda_bare_metal_version(cuda_dir):
if ((cuda_dir == None) or (torch.version.cuda == None)):
print('CUDA is not found, cpu version is installed')
return (None, (- 1), 0)
else:
raw_output = subprocess.check_output([(cuda_dir + '/bin/nvcc'), '-V'], universal_newlines=True)
... |
def alphafold_is_installed():
return (importlib.util.find_spec('alphafold') is not None)
|
def skip_unless_alphafold_installed():
return unittest.skipUnless(alphafold_is_installed(), 'Requires AlphaFold')
|
def import_alphafold():
"\n If AlphaFold is installed using the provided setuptools script, this\n is necessary to expose all of AlphaFold's precious insides\n "
if ('alphafold' in sys.modules):
return sys.modules['alphafold']
module = importlib.import_module('alphafold')
submodules =... |
def get_alphafold_config():
config = alphafold.model.config.model_config('model_1_ptm')
config.model.global_config.deterministic = True
return config
|
def get_global_pretrained_openfold():
global _model
if (_model is None):
_model = AlphaFold(model_config('model_1_ptm'))
_model = _model.eval()
if (not os.path.exists(_param_path)):
raise FileNotFoundError('Cannot load pretrained parameters. Make sure to run the \n ... |
def _get_orig_weights():
global _orig_weights
if (_orig_weights is None):
_orig_weights = np.load(_param_path)
return _orig_weights
|
def _remove_key_prefix(d, prefix):
for (k, v) in list(d.items()):
if k.startswith(prefix):
d.pop(k)
d[k[len(prefix):]] = v
|
def fetch_alphafold_module_weights(weight_path):
orig_weights = _get_orig_weights()
params = {k: v for (k, v) in orig_weights.items() if (weight_path in k)}
if ('/' in weight_path):
spl = weight_path.split('/')
spl = (spl if (len(spl[(- 1)]) != 0) else spl[:(- 1)])
module_name = sp... |
class TestDataTransforms(unittest.TestCase):
def test_make_seq_mask(self):
seq = torch.tensor([range(20)], dtype=torch.int64).transpose(0, 1)
seq_one_hot = torch.FloatTensor(seq.shape[0], 20).zero_()
seq_one_hot.scatter_(1, seq, 1)
protein_aatype = seq_one_hot.clone().detach()
... |
class TestInputEmbedder(unittest.TestCase):
def test_shape(self):
tf_dim = 2
msa_dim = 3
c_z = 5
c_m = 7
relpos_k = 11
b = 13
n_res = 17
n_clust = 19
tf = torch.rand((b, n_res, tf_dim))
ri = torch.rand((b, n_res))
msa = torch... |
class TestRecyclingEmbedder(unittest.TestCase):
def test_shape(self):
batch_size = 2
n = 3
c_z = 5
c_m = 7
min_bin = 0
max_bin = 10
no_bins = 9
re = RecyclingEmbedder(c_m, c_z, min_bin, max_bin, no_bins)
m_1 = torch.rand((batch_size, n, c_m)... |
class TestTemplateAngleEmbedder(unittest.TestCase):
def test_shape(self):
template_angle_dim = 51
c_m = 256
batch_size = 4
n_templ = 4
n_res = 256
tae = TemplateAngleEmbedder(template_angle_dim, c_m)
x = torch.rand((batch_size, n_templ, n_res, template_angl... |
class TestTemplatePairEmbedder(unittest.TestCase):
def test_shape(self):
batch_size = 2
n_templ = 3
n_res = 5
template_pair_dim = 7
c_t = 11
tpe = TemplatePairEmbedder(template_pair_dim, c_t)
x = torch.rand((batch_size, n_templ, n_res, n_res, template_pair_... |
class TestEvoformerStack(unittest.TestCase):
def test_shape(self):
batch_size = consts.batch_size
n_seq = consts.n_seq
n_res = consts.n_res
c_m = consts.c_m
c_z = consts.c_z
c_hidden_msa_att = 12
c_hidden_opm = 17
c_hidden_mul = 19
c_hidden_... |
class TestExtraMSAStack(unittest.TestCase):
def test_shape(self):
batch_size = 2
s_t = 23
n_res = 5
c_m = 7
c_z = 11
c_hidden_msa_att = 12
c_hidden_opm = 17
c_hidden_mul = 19
c_hidden_tri_att = 16
no_heads_msa = 3
no_heads_pa... |
class TestMSATransition(unittest.TestCase):
def test_shape(self):
batch_size = 2
s_t = 3
n_r = 5
c_m = 7
n = 11
mt = MSATransition(c_m, n)
m = torch.rand((batch_size, s_t, n_r, c_m))
shape_before = m.shape
m = mt(m, chunk_size=4)
sha... |
class TestImportWeights(unittest.TestCase):
def test_import_jax_weights_(self):
npz_path = 'openfold/resources/params/params_model_1_ptm.npz'
c = model_config('model_1_ptm')
c.globals.blocks_per_ckpt = None
model = AlphaFold(c)
import_jax_weights_(model, npz_path)
... |
def affine_vector_to_4x4(affine):
r = Rigid.from_tensor_7(affine)
return r.to_tensor_4x4()
|
class TestLoss(unittest.TestCase):
def test_run_torsion_angle_loss(self):
batch_size = consts.batch_size
n_res = consts.n_res
a = torch.rand((batch_size, n_res, 7, 2))
a_gt = torch.rand((batch_size, n_res, 7, 2))
a_alt_gt = torch.rand((batch_size, n_res, 7, 2))
los... |
class TestModel(unittest.TestCase):
def test_dry_run(self):
n_seq = consts.n_seq
n_templ = consts.n_templ
n_res = consts.n_res
n_extra_seq = consts.n_extra
c = model_config('model_1')
c.model.evoformer_stack.no_blocks = 4
c.model.evoformer_stack.blocks_per_... |
class TestMSARowAttentionWithPairBias(unittest.TestCase):
def test_shape(self):
batch_size = consts.batch_size
n_seq = consts.n_seq
n_res = consts.n_res
c_m = consts.c_m
c_z = consts.c_z
c = 52
no_heads = 4
chunk_size = None
mrapb = MSARowAt... |
class TestMSAColumnAttention(unittest.TestCase):
def test_shape(self):
batch_size = consts.batch_size
n_seq = consts.n_seq
n_res = consts.n_res
c_m = consts.c_m
c = 44
no_heads = 4
msaca = MSAColumnAttention(c_m, c, no_heads)
x = torch.rand((batch_s... |
class TestMSAColumnGlobalAttention(unittest.TestCase):
def test_shape(self):
batch_size = consts.batch_size
n_seq = consts.n_seq
n_res = consts.n_res
c_m = consts.c_m
c = 44
no_heads = 4
msagca = MSAColumnGlobalAttention(c_m, c, no_heads)
x = torch.... |
class TestOuterProductMean(unittest.TestCase):
def test_shape(self):
c = 31
opm = OuterProductMean(consts.c_m, consts.c_z, c)
m = torch.rand((consts.batch_size, consts.n_seq, consts.n_res, consts.c_m))
mask = torch.randint(0, 2, size=(consts.batch_size, consts.n_seq, consts.n_res)... |
class TestPairTransition(unittest.TestCase):
def test_shape(self):
c_z = consts.c_z
n = 4
pt = PairTransition(c_z, n)
batch_size = consts.batch_size
n_res = consts.n_res
z = torch.rand((batch_size, n_res, n_res, c_z))
mask = torch.randint(0, 2, size=(batch_... |
class TestLMA(unittest.TestCase):
def test_lma_vs_attention(self):
batch_size = consts.batch_size
c_hidden = 32
n = (2 ** 12)
no_heads = 4
q = torch.rand(batch_size, n, c_hidden).cuda()
kv = torch.rand(batch_size, n, c_hidden).cuda()
bias = [torch.rand(no_h... |
class TestStructureModule(unittest.TestCase):
def test_structure_module_shape(self):
batch_size = consts.batch_size
n = consts.n_res
c_s = consts.c_s
c_z = consts.c_z
c_ipa = 13
c_resnet = 17
no_heads_ipa = 6
no_query_points = 4
no_value_poi... |
class TestInvariantPointAttention(unittest.TestCase):
def test_shape(self):
c_m = 13
c_z = 17
c_hidden = 19
no_heads = 5
no_qp = 7
no_vp = 11
batch_size = 2
n_res = 23
s = torch.rand((batch_size, n_res, c_m))
z = torch.rand((batch_si... |
class TestAngleResnet(unittest.TestCase):
def test_shape(self):
batch_size = 2
n = 3
c_s = 13
c_hidden = 11
no_layers = 5
no_angles = 7
epsilon = 1e-12
ar = AngleResnet(c_s, c_hidden, no_layers, no_angles, epsilon)
a = torch.rand((batch_size... |
class TestTemplatePointwiseAttention(unittest.TestCase):
def test_shape(self):
batch_size = consts.batch_size
n_seq = consts.n_seq
c_t = consts.c_t
c_z = consts.c_z
c = 26
no_heads = 13
n_res = consts.n_res
inf = 10000000.0
tpa = TemplatePoi... |
class TestTemplatePairStack(unittest.TestCase):
def test_shape(self):
batch_size = consts.batch_size
c_t = consts.c_t
c_hidden_tri_att = 7
c_hidden_tri_mul = 7
no_blocks = 2
no_heads = 4
pt_inner_dim = 15
dropout = 0.25
n_templ = consts.n_te... |
class Template(unittest.TestCase):
@compare_utils.skip_unless_alphafold_installed()
def test_compare(self):
def test_template_embedding(pair, batch, mask_2d):
config = compare_utils.get_alphafold_config()
te = alphafold.model.modules.TemplateEmbedding(config.model.embeddings_... |
class TestTriangularAttention(unittest.TestCase):
def test_shape(self):
c_z = consts.c_z
c = 12
no_heads = 4
starting = True
tan = TriangleAttention(c_z, c, no_heads, starting)
batch_size = consts.batch_size
n_res = consts.n_res
x = torch.rand((batc... |
class TestTriangularMultiplicativeUpdate(unittest.TestCase):
def test_shape(self):
c_z = consts.c_z
c = 11
tm = TriangleMultiplicationOutgoing(c_z, c)
n_res = consts.c_z
batch_size = consts.batch_size
x = torch.rand((batch_size, n_res, n_res, c_z))
mask = t... |
def main(args):
os.makedirs(args.output_dir, exist_ok=True)
config = model_config(args.config_preset)
random_seed = args.data_random_seed
if (random_seed is None):
random_seed = random.randrange((2 ** 32))
numpy.random.seed(random_seed)
torch.manual_seed((random_seed + 1))
feature_... |
def get_args_parser():
parser = argparse.ArgumentParser('Output ddgs for all single and double mutations')
parser.add_argument('--name', type=str, help='name to save under')
parser.add_argument('--seq', type=str, help='raw sequence or fasta file')
parser.add_argument('--msa_dir', type=str, help='direc... |
@torch.no_grad()
def forward_esm(model, alphabet, args):
device = torch.device(args.device)
seqs = [('1', load_seq(args.seq))]
batch_converter = alphabet.get_batch_converter()
(_, _, x) = batch_converter(seqs)
x = x.to(device)
model.to(device)
pred = model(x, {'seqs': [load_seq(args.seq)]}... |
@torch.no_grad()
def forward_af(model, args):
device = torch.device(args.device)
from openfold.config import model_config
from openfold.data import feature_pipeline, data_pipeline
config = model_config('finetuning', train=True)
config.data.train.max_extra_msa = 1024
config.data.predict.max_ext... |
def load_seq(seq):
if ('.fasta' in seq):
for record in SeqIO.parse(seq, 'fasta'):
seq = str(record.seq)
return seq
|
def main(args):
print('WARNING: We observe a cysteine stabilization bias when examining DMS predictions (cysteine is often predicted to be the most stabilizing substitution). We are unsure if this is an artifact from the training data but attempts to fix this bias lead to worse metrics on the test set. Use cystei... |
@ex.config
def cfg_base():
uuid = 'basic'
cfg = {}
cfg['learner'] = {'algo': 'ppo', 'clip_param': 0.1, 'entropy_coef': 0.0001, 'eps': 1e-05, 'gamma': 0.99, 'internal_state_size': 512, 'lr': 0.0001, 'num_steps': 512, 'num_mini_batch': 8, 'num_stack': 4, 'max_grad_norm': 0.5, 'recurrent_policy': False, 'tau... |
@ex.named_config
def cfg_doom_navigation():
uuid = 'doom_visualnavigation'
cfg = {}
cfg['learner'] = {'algo': 'ppo', 'clip_param': 0.1, 'entropy_coef': 0.01, 'eps': 1e-05, 'gamma': 0.99, 'internal_state_size': 512, 'lr': 0.0001, 'num_steps': 200, 'num_mini_batch': 16, 'num_stack': 4, 'max_grad_norm': 0.5,... |
@ex.named_config
def scratch_doom():
uuid = 'doom_scratch'
cfg = {}
cfg['learner'] = {'perception_network': 'AtariNet', 'perception_network_kwargs': {'n_map_channels': 0, 'use_target': False}}
cfg['env'] = {'env_specific_kwargs': {'episode_timeout': 1000, 'n_clutter_objects': 8, 'n_goal_objects': 1}, ... |
@ex.named_config
def cfg_doom_exploration():
uuid = 'doom_myopicexploration'
cfg = {}
cfg['learner'] = {'algo': 'ppo', 'clip_param': 0.1, 'entropy_coef': 0.01, 'eps': 1e-05, 'gamma': 0.99, 'internal_state_size': 512, 'lr': 0.0001, 'num_steps': 200, 'num_mini_batch': 16, 'num_stack': 4, 'max_grad_norm': 0.... |
@ex.named_config
def scratch_doom_exploration():
uuid = 'doom_scratch_exploration'
cfg = {}
cfg['learner'] = {'perception_network': 'AtariNet', 'perception_network_kwargs': {'n_map_channels': 1, 'use_target': False}}
cfg['env'] = {'env_specific_kwargs': {}, 'transform_fn_pre_aggregation': "\n ... |
@ex.named_config
def cfg_exploration():
uuid = 'gibson_exploration'
cfg = {}
cfg['learner'] = {'algo': 'ppo', 'clip_param': 0.1, 'entropy_coef': 0.0001, 'eps': 1e-05, 'gamma': 0.99, 'internal_state_size': 512, 'lr': 0.0001, 'num_steps': 512, 'num_mini_batch': 8, 'num_stack': 4, 'max_grad_norm': 0.5, 'ppo_... |
@ex.named_config
def cfg_navigation():
uuid = 'gibson_visualnavigation'
cfg = {}
cfg['learner'] = {'algo': 'ppo', 'clip_param': 0.1, 'entropy_coef': 0.0001, 'eps': 1e-05, 'gamma': 0.99, 'internal_state_size': 512, 'lr': 0.0001, 'num_steps': 512, 'num_mini_batch': 8, 'num_stack': 4, 'max_grad_norm': 0.5, '... |
@ex.named_config
def cfg_planning():
uuid = 'gibson_coordinatenavigation'
cfg = {}
cfg['learner'] = {'algo': 'ppo', 'clip_param': 0.1, 'entropy_coef': 0.0001, 'eps': 1e-05, 'gamma': 0.99, 'internal_state_size': 512, 'lr': 0.0001, 'num_steps': 512, 'num_mini_batch': 8, 'num_stack': 4, 'max_grad_norm': 0.5,... |
@ex.named_config
def cfg_habitat():
uuid = 'habitat_core'
cfg = {}
cfg['learner'] = {'algo': 'ppo', 'clip_param': 0.1, 'entropy_coef': 0.0001, 'eps': 1e-05, 'gamma': 0.99, 'internal_state_size': 512, 'lr': 0.0001, 'num_steps': 1000, 'num_mini_batch': 8, 'num_stack': 4, 'max_grad_norm': 0.5, 'ppo_epoch': 8... |
@ex.named_config
def cfg_test():
cfg = {}
cfg['saving'] = {'resumable': True, 'checkpoint_configs': True}
override = {}
override['saving'] = {'visdom_server': 'localhost'}
override['env'] = {'num_processes': 10, 'num_val_processes': 10, 'env_specific_kwargs': {'test_mode': True, 'scenario_kwargs':... |
@ex.named_config
def planning():
uuid = 'habitat_planning'
cfg = {}
cfg['learner'] = {'perception_network_kwargs': {'n_map_channels': 3, 'use_target': True}}
cfg['env'] = {'env_name': 'Habitat_PointNav', 'transform_fn_pre_aggregation_fn': 'TransformFactory.independent', 'transform_fn_pre_aggregation_k... |
@ex.named_config
def exploration():
uuid = 'habitat_exploration'
cfg = {}
cfg['learner'] = {'lr': 0.001, 'perception_network_kwargs': {'n_map_channels': 1, 'use_target': False}}
cfg['env'] = {'env_name': 'Habitat_Exploration', 'transform_fn_pre_aggregation_fn': 'TransformFactory.independent', 'transfo... |
@ex.named_config
def small_settings5():
uuid = 'habitat_small_settings5'
cfg = {}
cfg['learner'] = {'num_steps': 512, 'replay_buffer_size': 1024, 'on_policy_epoch': 5, 'off_policy_epoch': 10, 'num_mini_batch': 24, 'rollout_value_batch_multiplier': 1}
cfg['env'] = {'num_processes': 6, 'num_val_processe... |
@ex.named_config
def cvpr_settings():
uuid = 'habitat_cvpr_settings'
cfg = {}
cfg['learner'] = {'num_steps': 512, 'replay_buffer_size': 4096, 'on_policy_epoch': 8, 'off_policy_epoch': 8, 'num_mini_batch': 8, 'rollout_value_batch_multiplier': 1}
cfg['env'] = {'num_processes': 6, 'num_val_processes': 1}... |
@ex.named_config
def prototype():
uuid = 'test'
cfg = {}
cfg['env'] = {'num_processes': 2, 'num_val_processes': 1, 'env_specific_kwargs': {'train_scenes': ['Adrian'], 'val_scenes': ['Denmark']}}
cfg['saving'] = {'log_interval': 2, 'vis_interval': 1}
|
@ex.named_config
def debug():
uuid = 'test'
cfg = {}
override = {}
cfg['learner'] = {'num_steps': 100, 'replay_buffer_size': 300, 'deterministic': True}
cfg['env'] = {'num_processes': 1, 'num_val_processes': 0, 'env_specific_kwargs': {'train_scenes': ['Adrian'], 'debug_mode': True}}
cfg['savin... |
@ex.config
def cfg_base():
cfg = {}
uuid = ''
config_file = os.path.join(os.getcwd(), 'habitat-api/configs/tasks/pointnav_gibson_val.yaml')
cfg['eval_kwargs'] = {'exp_path': '/mnt/logdir/keypoints3d_encoding_restart1', 'weights_only_path': None, 'challenge': True, 'debug': False, 'overwrite_configs': ... |
@ex.named_config
def weights_only():
cfg = {}
cfg['eval_kwargs'] = {'exp_path': None, 'weights_only_path': '/mnt/eval_runs/curvature_encoding_moresteps_collate5/checkpoints/weights_and_more-latest.dat'}
|
@ex.named_config
def cfg_overwrite():
cfg = {}
uuid = '_overwrite'
cfg['learner'] = {'taskonomy_encoder': '/mnt/models/keypoints3d_encoder.dat', 'perception_network': 'features_only', 'encoder_type': 'taskonomy', 'backout': {'use_backout': True, 'patience': 80, 'unstuck_dist': 0.3, 'randomize_actions': Tr... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.