-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.py
82 lines (73 loc) · 2.31 KB
/
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
82
from dataclasses import dataclass, field
from datetime import datetime
from typing import Any, List, Tuple
from hydra.core.config_store import ConfigStore
@dataclass
class DefaultConfig:
# training params
algo_name: str = ""
batch_size: int = 256
buffer_size: int = int(1e5)
num_epochs: int = 500
steps_per_epoch: int = 1000
start_steps: int = 1000
# env params
domain_name: str = "cheetah"
task_name: str = "run"
num_env: int = 10
action_repeat: int = 4
img_size: int = 84
camera_id: int = 0
# evaluation params
eval_episodes: int = 10
eval_every: int = 10
# general params
train_seed: int = 0
eval_seed: int = 42
# exp params
timestamp: str = datetime.now().strftime("%Y-%m-%d_%H-%M-%S")
env_name: str = "dm_control/${domain_name}-${task_name}-v0"
exp_name: str = "${algo_name}_${domain_name}-${task_name}-v0"
run_name: str = "${timestamp}_${exp_name}_${train_seed}"
run_dir: str = "${hydra:runtime.cwd}/logs/${exp_name}/${run_name}"
# hydra params
hydra: Any = field(
default_factory=lambda: {
"run": {"dir": "${run_dir}"},
"sweep": {"dir": ".tmp"},
"output_subdir": "${run_dir}",
"job": {"name": "debug", "chdir": "True"},
}
)
defaults: List[Any] = field(
default_factory=lambda: [
"_self_",
{"cfg": "cheetah_run"},
{"override hydra/job_logging": "colorlog"},
{"override hydra/hydra_logging": "colorlog"},
]
)
@dataclass(kw_only=True)
class DrQConfig(DefaultConfig):
# training params
algo_name: str = "drq"
# model params
latent_dim: int = 50
hidden_dim: int = 256
gamma: float = 0.99
critic_tau: float = 5e-3
actor_learning_rate: float = 3e-4
critic_learning_rate: float = 3e-4
alpha_learning_rate: float = 3e-4
init_alpha: float = 0.1
auto_alpha: bool = True
# encoder params
features_sizes: Tuple[int, int, int, int] = field(
default_factory=lambda: (32, 64, 128, 256)
)
kernel_sizes: Tuple[int, int, int, int] = field(
default_factory=lambda: (3, 3, 3, 3)
)
strides: Tuple[int, int, int, int] = field(default_factory=lambda: (2, 2, 2, 2))
cs = ConfigStore.instance()
cs.store(name="drq_config", node=DrQConfig)