forked from rainorangelemon/gnn-motion-planning
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.py
51 lines (43 loc) · 965 Bytes
/
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
import torch
import random
import numpy as np
class DotDict(dict):
def __getattr__(self, key):
return self[key]
def __setattr__(self, key, val):
if key in self.__dict__:
self.__dict__[key] = val
else:
self[key] = val
device = "cuda:0" if torch.cuda.is_available() else "cpu"
if device=='cpu':
config = DotDict({
'batch_size': 8,
'gamma': 2,
'alpha': 1,
'n': 1,
'lr': 1e-3,
'adam_eps': 1e-08,
'anchor_num': 64,
})
else:
config = DotDict({
'batch_size': 8,
'gamma': 2,
'alpha': 1,
'n': 1,
'lr': 1e-3,
'adam_eps': 1e-08,
'anchor_num': 64,
})
nn_config = DotDict({
'layer_num': 1,
'embed_dim': 32,
'feature_dim': 32,
'hidden_dim': 32,
'output_dim': 32,
})
def set_random_seed(seed):
np.random.seed(seed)
torch.manual_seed(seed)
random.seed(seed)