-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add classification losses for offline RL.
PiperOrigin-RevId: 600260970
- Loading branch information
Showing
6 changed files
with
528 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# Hyperparameters follow Hessel et al. (2018), except for sticky_actions, | ||
# which was False (not using sticky actions) in the original paper. | ||
import dopamine.jax.agents.full_rainbow.full_rainbow_agent | ||
import dopamine.jax.agents.dqn.dqn_agent | ||
import dopamine.discrete_domains.atari_lib | ||
import dopamine.discrete_domains.run_experiment | ||
import dopamine.labs.offline_rl.fixed_replay | ||
import dopamine.labs.offline_rl.jax.networks | ||
import dopamine.labs.offline_rl.jax.offline_rainbow_agent | ||
|
||
JaxDQNAgent.gamma = 0.99 | ||
JaxDQNAgent.update_horizon = 1 | ||
JaxDQNAgent.min_replay_history = 20000 # agent steps | ||
# update_period=1 is a sane default for offline RL. | ||
JaxDQNAgent.update_period = 1 | ||
JaxDQNAgent.target_update_period = 2000 # agent steps | ||
JaxDQNAgent.epsilon_eval = 0.001 | ||
JaxDQNAgent.epsilon_decay_period = 250000 # agent steps | ||
JaxDQNAgent.optimizer = 'adam' | ||
JaxDQNAgent.summary_writing_frequency = 2500 | ||
|
||
JaxFullRainbowAgent.dueling = False # Don't use duelling networks. | ||
JaxFullRainbowAgent.double_dqn = True | ||
JaxFullRainbowAgent.num_atoms = 51 | ||
JaxFullRainbowAgent.replay_scheme = 'uniform' | ||
JaxFullRainbowAgent.vmax = 10. | ||
|
||
OfflineClassyCQLAgent.td_coefficient = 1.0 | ||
OfflineClassyCQLAgent.bc_coefficient = 0.1 | ||
|
||
JaxFullRainbowAgent.network = @networks.ParameterizedRainbowNetwork | ||
|
||
# Use parameters similar to that of C51. | ||
create_optimizer.learning_rate = 6.25e-5 | ||
create_optimizer.eps = 0.0003125 | ||
|
||
atari_lib.create_atari_environment.game_name = 'Pong' | ||
# Sticky actions with probability 0.25, as suggested by (Machado et al., 2017). | ||
atari_lib.create_atari_environment.sticky_actions = True | ||
create_runner.schedule = 'continuous_train' | ||
create_agent.agent_name = 'classy_cql' | ||
create_agent.debug_mode = True | ||
Runner.num_iterations = 100 | ||
Runner.training_steps = 62_500 # agent steps | ||
Runner.evaluation_steps = 125000 # agent steps | ||
Runner.max_steps_per_episode = 27000 # agent steps | ||
|
||
JaxFixedReplayBuffer.replay_capacity = 50000 | ||
JaxFixedReplayBuffer.batch_size = 32 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.