eff70fcc79aee2af0f4528ef16499c5dce3662e0,tf_agents/experimental/examples/ppo/ppo_learner.py,PPOLearner,_update_normalizers,#PPOLearner#Any#,216

Before Change



  @common.function(autograph=True)
  def _update_normalizers(self, dataset):
    iterator = iter(dataset)
    traj, _ = next(iterator)
    self._agent.update_observation_normalizer(traj.observation)
    self._agent.update_reward_normalizer(traj.reward)

    for traj, _ in iterator:
      self._agent.update_observation_normalizer(traj.observation)
      self._agent.update_reward_normalizer(traj.reward)

  @common.function(autograph=True)
  def _update_advantage_normalizer(self, dataset):
    self._agent._reset_advantage_normalizer()  // pylint: disable=protected-access

After Change


    num_frames += _update(traj)

    for _ in tf.range(1, self._num_batches):
      traj, _ = next(iterator)
      num_frames += _update(traj)

    return num_frames
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: tensorflow/agents
Commit Name: eff70fcc79aee2af0f4528ef16499c5dce3662e0
Time: 2020-10-02
Author: summeryue@google.com
File Name: tf_agents/experimental/examples/ppo/ppo_learner.py
Class Name: PPOLearner
Method Name: _update_normalizers


Project Name: pantsbuild/pants
Commit Name: 831b005905d3f3dd36269cccf9186d1ee1110858
Time: 2015-07-24
Author: john.sirois@gmail.com
File Name: src/python/pants/backend/python/interpreter_cache.py
Class Name: PythonInterpreterCache
Method Name: _resolve_and_link


Project Name: soft-matter/trackpy
Commit Name: c6607119c25d0178245243ef3fdd3d176dd0d8f2
Time: 2020-01-22
Author: anntzer.lee@gmail.com
File Name: trackpy/linking/utils.py
Class Name:
Method Name: coords_from_df