(self, mu, sigma)
| 328 | |
| 329 | |
| 330 | def get_action(self, mu, sigma): |
| 331 | action = self._get_action_beta(mu.view(1,2), sigma.view(1,2)) |
| 332 | acc, steer = action[:, 0], action[:, 1] |
| 333 | if acc >= 0.0: |
| 334 | throttle = acc |
| 335 | brake = torch.zeros_like(acc) |
| 336 | else: |
| 337 | throttle = torch.zeros_like(acc) |
| 338 | brake = torch.abs(acc) |
| 339 | |
| 340 | throttle = torch.clamp(throttle, 0, 1) |
| 341 | steer = torch.clamp(steer, -1, 1) |
| 342 | brake = torch.clamp(brake, 0, 1) |
| 343 | |
| 344 | return throttle, steer, brake |
no test coverage detected