(self, obs_dict: Dict[str, th.Tensor], actions: th.Tensor, exploration_suggests,
detach_values=False)
| 118 | return self.action_dist.proba_distribution(mu, sigma), mu.detach().cpu().numpy(), sigma.detach().cpu().numpy() |
| 119 | |
| 120 | def evaluate_actions(self, obs_dict: Dict[str, th.Tensor], actions: th.Tensor, exploration_suggests, |
| 121 | detach_values=False): |
| 122 | features = self._get_features(**obs_dict) |
| 123 | |
| 124 | if detach_values: |
| 125 | detached_features = features.detach() |
| 126 | values = self.value_head(detached_features) |
| 127 | else: |
| 128 | values = self.value_head(features) |
| 129 | |
| 130 | distribution, mu, sigma = self._get_action_dist_from_features(features) |
| 131 | actions = self.scale_action(actions) |
| 132 | log_prob = distribution.log_prob(actions) |
| 133 | return values.flatten(), log_prob, distribution.entropy_loss(), \ |
| 134 | distribution.exploration_loss(exploration_suggests), distribution.distribution |
| 135 | |
| 136 | def evaluate_values(self, obs_dict: Dict[str, th.Tensor]): |
| 137 | features = self._get_features(**obs_dict) |
no test coverage detected