mirror of
https://github.com/vale981/ray
synced 2025-03-08 19:41:38 -05:00

* Remove all __future__ imports from RLlib. * Remove (object) again from tf_run_builder.py::TFRunBuilder. * Fix 2xLINT warnings. * Fix broken appo_policy import (must be appo_tf_policy) * Remove future imports from all other ray files (not just RLlib). * Remove future imports from all other ray files (not just RLlib). * Remove future import blocks that contain `unicode_literals` as well. Revert appo_tf_policy.py to appo_policy.py (belongs to another PR). * Add two empty lines before Schedule class. * Put back __future__ imports into determine_tests_to_run.py. Fails otherwise on a py2/print related error.
35 lines
1.1 KiB
Python
35 lines
1.1 KiB
Python
"""Experimental: scalable Ape-X variant of QMIX"""
|
|
|
|
from ray.rllib.agents.dqn.apex import APEX_TRAINER_PROPERTIES
|
|
from ray.rllib.agents.qmix.qmix import QMixTrainer, \
|
|
DEFAULT_CONFIG as QMIX_CONFIG
|
|
from ray.rllib.utils import merge_dicts
|
|
|
|
APEX_QMIX_DEFAULT_CONFIG = merge_dicts(
|
|
QMIX_CONFIG, # see also the options in qmix.py, which are also supported
|
|
{
|
|
"optimizer": merge_dicts(
|
|
QMIX_CONFIG["optimizer"],
|
|
{
|
|
"max_weight_sync_delay": 400,
|
|
"num_replay_buffer_shards": 4,
|
|
"batch_replay": True, # required for RNN. Disables prio.
|
|
"debug": False
|
|
}),
|
|
"num_gpus": 0,
|
|
"num_workers": 32,
|
|
"buffer_size": 2000000,
|
|
"learning_starts": 50000,
|
|
"train_batch_size": 512,
|
|
"sample_batch_size": 50,
|
|
"target_network_update_freq": 500000,
|
|
"timesteps_per_iteration": 25000,
|
|
"per_worker_exploration": True,
|
|
"min_iter_time_s": 30,
|
|
},
|
|
)
|
|
|
|
ApexQMixTrainer = QMixTrainer.with_updates(
|
|
name="APEX_QMIX",
|
|
default_config=APEX_QMIX_DEFAULT_CONFIG,
|
|
**APEX_TRAINER_PROPERTIES)
|