MCPcopy Create free account
hub / github.com/OpenDriveLab/DriveAdapter / __init__

Method __init__

roach/models/distributions.py:18–42  ·  view source on GitHub ↗
(self, action_dim: int, dist_init=None, action_dependent_std=False)

Source from the content-addressed store, hash-verified

16
17class DiagGaussianDistribution():
18 def __init__(self, action_dim: int, dist_init=None, action_dependent_std=False):
19 self.distribution = None
20 self.action_dim = action_dim
21 self.dist_init = dist_init
22 self.action_dependent_std = action_dependent_std
23
24 self.low = None
25 self.high = None
26 self.log_std_max = 2
27 self.log_std_min = -20
28
29 # [mu, log_std], [0, 1]
30 self.acc_exploration_dist = {
31 'go': th.FloatTensor([0.66, -3]),
32 'stop': th.FloatTensor([-0.66, -3])
33 }
34 self.steer_exploration_dist = {
35 'turn': th.FloatTensor([0.0, -1]),
36 'straight': th.FloatTensor([3.0, 3.0])
37 }
38
39 if th.cuda.is_available():
40 self.device = 'cuda'
41 else:
42 self.device = 'cpu'
43
44 def proba_distribution_net(self, latent_dim: int) -> Tuple[nn.Module, nn.Parameter]:
45 mean_actions = nn.Linear(latent_dim, self.action_dim)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected