6c44fb28fecdb666182e2951b7b1cbe9cf198ff1,baselines/her/rollout.py,RolloutWorker,generate_rollouts,#RolloutWorker#,64
Before Change
ag_new = np.empty((self.rollout_batch_size, self.dims["g"]))
success = np.zeros(self.rollout_batch_size)
// compute new states and observations
for i in range(self.rollout_batch_size):
try:
// We fully ignore the reward here because it will have to be re-computed
// for HER.
curr_o_new, _, _, info = self.envs[i].step(u[i])
if "is_success" in info:
success[i] = info["is_success"]
o_new[i] = curr_o_new["observation"]
ag_new[i] = curr_o_new["achieved_goal"]
for idx, key in enumerate(self.info_keys):
info_values[idx][t, i] = info[key]
if self.render:
self.envs[i].render()
except MujocoException as e:
return self.generate_rollouts()
if np.isnan(o_new).any():
self.logger.warn("NaN caught during rollout generation. Trying again...")
self.reset_all_rollouts()
return self.generate_rollouts()
After Change
// after a reset
break
for i, info_dict in enumerate(info):
for idx, key in enumerate(self.info_keys):
info_values[idx][t, i] = info[i][key]
if np.isnan(o_new).any():
self.logger.warn("NaN caught during rollout generation. Trying again...")
self.reset_all_rollouts()
return self.generate_rollouts()
In pattern: SUPERPATTERN
Frequency: 4
Non-data size: 8
Instances
Project Name: openai/baselines
Commit Name: 6c44fb28fecdb666182e2951b7b1cbe9cf198ff1
Time: 2018-12-19
Author: peterzhokhoff@gmail.com
File Name: baselines/her/rollout.py
Class Name: RolloutWorker
Method Name: generate_rollouts
Project Name: OpenNMT/OpenNMT-tf
Commit Name: 3908c2eab94344308f523d5e6ccc5b10ac158da9
Time: 2019-07-03
Author: guillaume.klein@systrangroup.com
File Name: opennmt/training.py
Class Name: Trainer
Method Name: __call__
Project Name: uber/ludwig
Commit Name: 7d9db23a389499c2764fb850cd19f853cc3e8565
Time: 2019-08-08
Author: smiryala@uber.com
File Name: ludwig/features/image_feature.py
Class Name: ImageBaseFeature
Method Name: add_feature_data
Project Name: uber/ludwig
Commit Name: 5667af96dade79ef77194d519182d4989494b3a4
Time: 2019-08-25
Author: smiryala@uber.com
File Name: ludwig/features/image_feature.py
Class Name: ImageBaseFeature
Method Name: add_feature_data