71ec57f993d28f83bea04953cc51365942cb4894,tf_agents/agents/behavioral_cloning/behavioral_cloning_agent_test.py,BehavioralCloningAgentTest,testTrainWithNN,#BehavioralCloningAgentTest#Any#,182

Before Change


    // Disable clipping to make sure we can see the difference in behavior
    agent.policy._clip = False
    // Remove policy_info, as BehavioralCloningAgent expects none.
    traj = traj.replace(policy_info=())
    // TODO(b/123883319)
    if tf.executing_eagerly():
      train_and_loss = lambda: agent.train(traj)
    else:
      train_and_loss = agent.train(traj)
    replay = trajectory_replay.TrajectoryReplay(agent.policy)
    self.evaluate(tf.compat.v1.global_variables_initializer())
    initial_actions = self.evaluate(replay.run(traj)[0])
    for _ in range(TRAIN_ITERATIONS):
      self.evaluate(train_and_loss)
      post_training_actions = self.evaluate(replay.run(traj)[0])
    post_training_actions = self.evaluate(replay.run(traj)[0])
    // We don"t necessarily converge to the same actions as in trajectory after
    // 10 steps of an untuned optimizer, but the policy does change.
    self.assertFalse(np.all(initial_actions == post_training_actions))

After Change



    // We don"t necessarily converge to the same actions as in trajectory after
    // 10 steps of an untuned optimizer, but the loss should go down.
    self.assertGreater(initial_loss, loss)

  def testTrainWithSingleOuterDimension(self):
    // Hard code a trajectory shaped (time=6, batch=1, ...).
    traj, time_step_spec, action_spec = create_arbitrary_trajectory()
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: tensorflow/agents
Commit Name: 71ec57f993d28f83bea04953cc51365942cb4894
Time: 2020-02-07
Author: summeryue@google.com
File Name: tf_agents/agents/behavioral_cloning/behavioral_cloning_agent_test.py
Class Name: BehavioralCloningAgentTest
Method Name: testTrainWithNN


Project Name: tensorflow/agents
Commit Name: b5ae1c6bde39f5130c975992198f1f8ee5200f9a
Time: 2020-06-22
Author: ebrevdo@google.com
File Name: tf_agents/policies/q_policy_test.py
Class Name: QPolicyTest
Method Name: testActionWithinBounds


Project Name: tensorflow/agents
Commit Name: 9a3e9d21273da7ae40da9f70cb6df1b077b08105
Time: 2019-12-05
Author: kbanoop@google.com
File Name: tf_agents/networks/actor_distribution_network_test.py
Class Name: ActorDistributionNetworkTest
Method Name: testDropoutFCLayersWithConv