b208fa6cf8bde0ed8a315eef6656271a77ce9d83,texar/agents/dqn_agent.py,DQNAgent,get_action,#DQNAgent#Any#Any#,153
Before Change
feed_dict={self.state_input: np.array([state])})
action = np.zeros(shape=(self.actions,))
if random.random() < self.exploration.get_epsilon(self.timestep):
while True:
action_id = random.randrange(self.actions)
if action_mask[action_id]:
break
else:
for i in range(self.actions):
if not action_mask[i]:
qvalue[i] -= 10.0 ** 9
After Change
qvalue = self._sess.run(
self._qnet_outputs["qvalues"],
feed_dict={self._observ_inputs: np.array([observ]),
tx.global_mode(): tf.estimator.ModeKeys.PREDICT})
action = np.zeros(shape=self._num_actions)
if random.random() < self._exploration.get_epsilon(self.timestep):
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 3
Instances
Project Name: asyml/texar
Commit Name: b208fa6cf8bde0ed8a315eef6656271a77ce9d83
Time: 2018-07-29
Author: tanbowen@sjtu.edu.cn
File Name: texar/agents/dqn_agent.py
Class Name: DQNAgent
Method Name: get_action
Project Name: facebookresearch/pytext
Commit Name: 5a8868024c4ece64611ae75107b00b66e0892684
Time: 2019-05-24
Author: snl@fb.com
File Name: pytext/data/data.py
Class Name: Data
Method Name: batches
Project Name: erikbern/ann-benchmarks
Commit Name: 845a5692cd16a152572e8818dbdecfd5d7a7764a
Time: 2017-12-09
Author: mail@erikbern.com
File Name: ann_benchmarks/runner.py
Class Name:
Method Name: run_docker