This commit is contained in:
LinZichuan 2020-09-20 12:59:29 +00:00
Родитель 7ac67e827e
Коммит 0980bde05d
4 изменённых файлов: 10 добавлений и 2 удалений

Просмотреть файл

@ -32,7 +32,7 @@ tf.train.AdamOptimizer.epsilon = 0.0003125
atari_lib.create_atari_environment.game_name = 'GAME'
atari_lib.create_atari_environment.sticky_actions = False
create_agent.agent_name = 'implicit_quantile'
create_agent.agent_name = 'fqf'
Runner.num_iterations = 200
Runner.game = 'GAME'
Runner.runtype = 'RUNTYPE'

Просмотреть файл

@ -124,7 +124,10 @@ class FQFAgent(rainbow_agent.RainbowAgent):
# have been run. This matches the Nature DQN behaviour.
if self._replay.memory.add_count > self.min_replay_history:
if self.training_steps % self.update_period == 0:
_, _, _, loss, loss1, quan_value, quan, vdiff = self._sess.run(self._train_op)
if 'sqloss' in self._runtype:
_, _, loss, loss1, quan_value, quan, vdiff = self._sess.run(self._train_op)
else:
_, _, _, loss, loss1, quan_value, quan, vdiff = self._sess.run(self._train_op)
if self.training_steps % 50000 == 0:
batchsize = 32
quan_value = np.reshape(quan_value, [batchsize, self.num_tau_samples])

Двоичные данные
dopamine/discrete_domains/.run_experiment.py.swp

Двоичный файл не отображается.

Просмотреть файл

@ -27,6 +27,7 @@ import csv, json, pickle
from dopamine.agents.dqn import dqn_agent
from dopamine.agents.implicit_quantile import implicit_quantile_agent
from dopamine.agents.rainbow import rainbow_agent
from dopamine.agents.fqf import fqf_agent
from dopamine.discrete_domains import atari_lib
from dopamine.discrete_domains import checkpointer
from dopamine.discrete_domains import iteration_statistics
@ -87,6 +88,10 @@ def create_agent(sess, environment, agent_name=None, summary_writer=None,
return implicit_quantile_agent.ImplicitQuantileAgent(
sess, num_actions=environment.action_space.n,
summary_writer=summary_writer)
elif agent_name == 'fqf':
return fqf_agent.FQFAgent(
sess, num_actions=environment.action_space.n,
summary_writer=summary_writer)
else:
raise ValueError('Unknown agent: {}'.format(agent_name))