-
Notifications
You must be signed in to change notification settings - Fork 2
/
params.py
92 lines (85 loc) · 2.03 KB
/
params.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
from argparse import Namespace
training_params = Namespace(
model_type="sa",
dataset="boxworld",
num_slots=10,
num_iterations=3,
accumulate_grad_batches=1,
data_root="data/box_world_dataset.h5",
accelerator="gpu",
devices=-1,
max_steps=-1,
num_sanity_val_steps=1,
num_workers=4,
is_logger_enabled=True,
gradient_clip_val=0.0,
n_samples=16,
clevrtex_dataset_variant="full",
alternative_crop=True, # Alternative crop for RAVENS dataset
)
slot_attention_params = Namespace(
lr_main=4e-4,
batch_size=64,
val_batch_size=64,
resolution=(128, 128),
slot_size=64,
max_epochs=1000,
max_steps=500000,
weight_decay=0.0,
mlp_hidden_size=128,
scheduler="warmup_and_decay",
scheduler_gamma=0.5,
warmup_steps_pct=0.02,
decay_steps_pct=0.2,
use_separation_loss="entropy",
separation_tau_start=60_000,
separation_tau_end=65_000,
separation_tau_max_val=0.003,
separation_tau=None,
boxworld_group_objects=True,
use_area_loss=True,
area_tau_start=60_000,
area_tau_end=65_000,
area_tau_max_val=0.006,
area_tau=None,
)
slate_params = Namespace(
lr_dvae=3e-4,
lr_main=1e-4,
weight_decay=0.0,
batch_size=50,
val_batch_size=50,
max_epochs=1000,
patience=4,
gradient_clip_val=1.0,
resolution=(128, 128),
num_dec_blocks=8,
vocab_size=4096,
d_model=192,
num_heads=8,
dropout=0.1,
slot_size=192,
mlp_hidden_size=192,
tau_start=1.0,
tau_final=0.1,
tau_steps=30000,
scheduler="warmup",
lr_warmup_steps=30000,
hard=False,
)
gnm_params = Namespace(
std=0.2, # 0.4 on CLEVR, 0.7 on ClevrTex, 0.2/0.3 on RAVENS
z_what_dim=64,
z_bg_dim=10,
lr_main=1e-4,
batch_size=64,
val_batch_size=64,
resolution=(128, 128),
gradient_clip_val=1.0,
max_epochs=1000,
max_steps=5_000_000,
weight_decay=0.0,
scheduler=None,
)
def merge_namespaces(one: Namespace, two: Namespace):
return Namespace(**{**vars(one), **vars(two)})