-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathtrain_config.py
executable file
·81 lines (76 loc) · 2.57 KB
/
train_config.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
from ml_collections import ConfigDict
def get_config(config_string):
base_real_config = dict(
batch_size=512,
num_steps=int(1001000),
log_interval=1000,
eval_interval=25000,
save_interval=25000,
num_val_trajs=8,
num_val_batches=8,
save_dir="~/jaxrl_log",
resume_path="",
seed=42,
)
base_data_config = dict(
# action_merge_horizon=2,
shuffle_buffer_size=25000,
augment=True,
augment_next_obs_goal_differently=False,
augment_kwargs=dict(
random_resized_crop=dict(scale=[0.8, 1.0], ratio=[0.9, 1.1]),
random_brightness=[0.2],
random_contrast=[0.8, 1.2],
random_saturation=[0.8, 1.2],
random_hue=[0.1],
augment_order=[
"random_resized_crop",
"random_brightness",
"random_contrast",
"random_saturation",
"random_hue",
],
),
)
possible_structures = {
"gc_bc_offline_bridge": ConfigDict(
dict(
agent="gc_bc",
agent_kwargs=dict(
network_kwargs=dict(
hidden_dims=(
256,
256,
256,
),
dropout_rate=0.1,
),
policy_kwargs=dict(
tanh_squash_distribution=True,
std_parameterization="fixed",
fixed_std=[1, 1, 1, 1, 1, 1, 0.1],
),
early_goal_concat=True,
shared_goal_encoder=True,
use_proprio=False,
learning_rate=3e-4,
warmup_steps=2000,
decay_steps=int(2e6),
),
dataset_kwargs=dict(
goal_relabeling_strategy="geometric",
goal_relabeling_kwargs=dict(reached_proportion=0.0, discount=0.98),
normalization_type="normal",
**base_data_config,
),
encoder="resnetv1-34-bridge", # diff: bridge release use resnet-50
encoder_kwargs=dict(
pooling_method="avg",
add_spatial_coordinates=True,
act="swish",
),
**base_real_config,
)
),
}
return possible_structures[config_string]