mirror of
https://github.com/wassname/ray.git
synced 2026-08-20 12:40:44 +08:00
* add carla example * add reward * set obs * Sun Dec 17 16:06:00 PST 2017 * add spec * fix measurement * add train script * resize to 80x80 * null * initial small training run * robustify env, clean up action space * clean up vars * switch to town2 which is faster * tunify train.py * add discrete mode * update * fix excessive brakinG * fix the weather * rename * redirect output and from future import * doc * update * fix rebase * allow dqn gpu growht * adjust dqn hyperparams * better ppo parameters
36 lines
871 B
Python
36 lines
871 B
Python
from __future__ import absolute_import
|
|
from __future__ import division
|
|
from __future__ import print_function
|
|
|
|
from ray.tune import register_env, run_experiments
|
|
|
|
from env import CarlaEnv, ENV_CONFIG
|
|
|
|
env_name = "carla_env"
|
|
env_config = ENV_CONFIG.copy()
|
|
env_config.update({
|
|
"x_res": 210,
|
|
"y_res": 160,
|
|
"use_depth_camera": False,
|
|
"discrete_actions": True,
|
|
"max_steps": 50,
|
|
})
|
|
register_env(env_name, lambda: CarlaEnv(env_config))
|
|
|
|
run_experiments({
|
|
"carla": {
|
|
"run": "DQN",
|
|
"env": "carla_env",
|
|
"resources": {"cpu": 4, "gpu": 1},
|
|
"config": {
|
|
"timesteps_per_iteration": 100,
|
|
"learning_starts": 1000,
|
|
"schedule_max_timesteps": 100000,
|
|
"gamma": 0.95,
|
|
"tf_session_args": {
|
|
"gpu_options": {"allow_growth": True},
|
|
},
|
|
},
|
|
},
|
|
})
|