da6b040e254710f0df907d838db51f4f2cc9bf93,social_rl/multiagent_tfagents/multiagent_ppo.py,MultiagentPPO,get_single_agent_specs,#MultiagentPPO#Any#Any#,217

Before Change


  def get_single_agent_specs(self, time_step_spec, action_spec):
    Get single agent version of environment specs to feed to baby agents.
    single_obs_spec = collections.OrderedDict()
    for k in time_step_spec.observation.keys():
      if k == "direction":
        shape = [1]
      elif k == "image":
        // Remove agent dimension
        shape = time_step_spec.observation[k].shape[1:]
      else:
        // Additional control fields like "reward", and "done" should not be sent
        // to individual agents
        continue
      single_obs_spec[k] = tensor_spec.BoundedTensorSpec(
          shape=shape, name=time_step_spec.observation[k].name,
          minimum=time_step_spec.observation[k].minimum,
          maximum=time_step_spec.observation[k].maximum,
          dtype=time_step_spec.observation[k].dtype)
    single_reward_spec = tensor_spec.TensorSpec(
        shape=(), dtype=time_step_spec.reward.dtype, name="reward")
    single_time_step_spec = ts_lib.TimeStep(
        time_step_spec.step_type, single_reward_spec,

After Change


          maximum=spec.maximum,
          dtype=spec.dtype)

    single_obs_spec = tf.nest.map_structure(make_single_agent_spec,
                                            time_step_spec.observation)
    single_reward_spec = tensor_spec.TensorSpec(
        shape=(), dtype=time_step_spec.reward.dtype, name="reward")
    single_time_step_spec = ts_lib.TimeStep(time_step_spec.step_type,
                                            single_reward_spec,
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 6

Instances


Project Name: google-research/google-research
Commit Name: da6b040e254710f0df907d838db51f4f2cc9bf93
Time: 2021-03-08
Author: ldennis@google.com
File Name: social_rl/multiagent_tfagents/multiagent_ppo.py
Class Name: MultiagentPPO
Method Name: get_single_agent_specs


Project Name: ray-project/ray
Commit Name: 1775e89f262111791fabfd40f80a24f74738fe54
Time: 2020-04-28
Author: sven@anyscale.io
File Name: rllib/models/tf/tf_action_dist.py
Class Name: MultiActionDistribution
Method Name: logp


Project Name: ray-project/ray
Commit Name: 876a1ba5bd0c5570dae7de7e3334bbe85e561d17
Time: 2020-03-06
Author: sven@anyscale.io
File Name: rllib/utils/torch_ops.py
Class Name:
Method Name: convert_to_non_torch_type