2a548989f90026395d3d47ccf15ac331728c64bf,ml/rl/test/gym/gym_evaluator.py,GymEvaluator,evaluate_reward_value,#GymEvaluator#Any#,156
Before Change
if self._env.action_type == EnvType.CONTINUOUS_ACTION:
raise NotImplementedError()
// test only float features
predictions = predictor.predict(self.logged_states).astype(np.float32)
estimated_reward_values = predictor.estimate_reward(self.logged_states)
if isinstance(predictor.trainer, ParametricDQNTrainer):
predictions = predictions.reshape([-1, self._env.action_dim])
estimated_reward_values = estimated_reward_values.reshape(
After Change
)
estimated_reward_values = predictor.estimate_reward(self.logged_states)
else:
num_states = self.logged_states.size()[0]
action_tiled = torch.repeat_interleave(
torch.eye(self._env.action_dim), repeats=num_states, axis=0
)
predictions = predictor.predict( // type: ignore
self.logged_states, action_tiled
)
estimated_reward_values = predictor.estimate_reward(
self.logged_states, action_tiled
)
predictions = predictions.reshape([-1, self._env.action_dim])
estimated_reward_values = estimated_reward_values.reshape(
[-1, self._env.action_dim]
)
In pattern: SUPERPATTERN
Frequency: 4
Non-data size: 5
Instances
Project Name: facebookresearch/Horizon
Commit Name: 2a548989f90026395d3d47ccf15ac331728c64bf
Time: 2019-06-22
Author: jjg@fb.com
File Name: ml/rl/test/gym/gym_evaluator.py
Class Name: GymEvaluator
Method Name: evaluate_reward_value
Project Name: facebookresearch/Horizon
Commit Name: 542e7357abbb0f1d9874256f51fd6e03aded7824
Time: 2017-10-11
Author: hychyc07@cs.utexas.edu
File Name: rlmodels/dqn.py
Class Name: DQN_rlnn
Method Name: get_action_policy_batch
Project Name: nilearn/nilearn
Commit Name: e706526aef384392be0395e7c69e3795289ada11
Time: 2015-07-28
Author: elvis.dohmatob@inria.fr
File Name: nilearn/decoding/tests/test_same_api.py
Class Name:
Method Name: test_smoothlasso_and_tvl1_same_for_pure_l1
Project Name: nilearn/nilearn
Commit Name: 56f63c1ee1e1bf5d06550373b39caa085fdc9f12
Time: 2015-07-28
Author: elvis.dohmatob@inria.fr
File Name: nilearn/decoding/tests/test_same_api.py
Class Name:
Method Name: test_smoothlasso_and_tvl1_same_for_pure_l1