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

Method forward_policy

roach/models/ppo_policy.py:175–180  ·  view source on GitHub ↗
(self, obs_dict: Dict[str, np.ndarray])

Source from the content-addressed store, hash-verified

173 return values
174
175 def forward_policy(self, obs_dict: Dict[str, np.ndarray]) -> np.ndarray:
176 with th.no_grad():
177 obs_tensor_dict = dict([(k, th.as_tensor(v).to(self.device)) for k, v in obs_dict.items()])
178 features, cnn_feature = self._get_features(**obs_tensor_dict)
179 distribution, mu, sigma = self._get_action_dist_from_features(features)
180 return mu, sigma
181
182 def scale_action(self, action: th.Tensor, eps=1e-7) -> th.Tensor:
183 # input action \in [a_low, a_high]

Callers

nothing calls this directly

Calls 2

_get_featuresMethod · 0.95

Tested by

no test coverage detected