ca4c92fe1b53086373cfca478560df06b03701d8,examples/atari_dqn/convnet.py,ConvNet,train_on_batch,#ConvNet#Any#Any#,60
Before Change
actions = x[1].astype(np.int)
t = self.q.predict(x[0])
for i in xrange(t.shape[0]):
t[i, actions[i]] = y[i]
loss = self.q.train_on_batch(x[0], t, **fit_params)
summary = tf.Summary(value=[tf.Summary.Value(tag="loss",
simple_value=loss), ])
self.writer.add_summary(summary)
After Change
return self._session.run(self.q, feed_dict={self._x: x})
def train_on_batch(self, x, y, **fit_params):
self._session.run(self._train_step,
feed_dict={self._x: x[0],
self._action: x[1].ravel().astype(
np.uint8),
self._target_q: y})
def set_weights(self, weights):
with tf.variable_scope(self._name):
w = tf.get_collection(ops.GraphKeys.TRAINABLE_VARIABLES,
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 6
Instances Project Name: AIRLab-POLIMI/mushroom
Commit Name: ca4c92fe1b53086373cfca478560df06b03701d8
Time: 2017-08-28
Author: carlo.deramo@gmail.com
File Name: examples/atari_dqn/convnet.py
Class Name: ConvNet
Method Name: train_on_batch
Project Name: reinforceio/tensorforce
Commit Name: 3882ff98e3a8e2a4e16393e72f7107e191c06cf7
Time: 2017-05-15
Author: mi.schaarschmidt@gmail.com
File Name: tensorforce/tests/test_dqn_agent.py
Class Name: TestDQNAgent
Method Name: test_dqn_agent
Project Name: reinforceio/tensorforce
Commit Name: 3882ff98e3a8e2a4e16393e72f7107e191c06cf7
Time: 2017-05-15
Author: mi.schaarschmidt@gmail.com
File Name: tensorforce/tests/test_dqfd_agent.py
Class Name: TestDQFDAgent
Method Name: test_dqfd_agent