(self, action_dim: int, dist_init=None, action_dependent_std=False)
| 16 | |
| 17 | class 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) |
nothing calls this directly
no outgoing calls
no test coverage detected