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

Method __init__

roach/models/distributions.py:175–199  ·  view source on GitHub ↗
(self, action_dim=2, dist_init=None)

Source from the content-addressed store, hash-verified

173
174class BetaDistribution():
175 def __init__(self, action_dim=2, dist_init=None):
176 assert action_dim == 2
177
178 self.distribution = None
179 self.action_dim = action_dim
180 self.dist_init = dist_init
181 self.low = 0.0
182 self.high = 1.0
183
184 # [beta, alpha], [0, 1]
185 self.acc_exploration_dist = {
186 # [1, 2.5]
187 # [1.5, 1.0]
188 'go': th.FloatTensor([1.0, 2.5]),
189 'stop': th.FloatTensor([1.5, 1.0])
190 }
191 self.steer_exploration_dist = {
192 'turn': th.FloatTensor([1.0, 1.0]),
193 'straight': th.FloatTensor([3.0, 3.0])
194 }
195
196 if th.cuda.is_available():
197 self.device = 'cuda'
198 else:
199 self.device = 'cpu'
200
201 def proba_distribution_net(self, latent_dim: int) -> Tuple[nn.Module, nn.Module]:
202

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected