mirror of
https://github.com/gryf/coach.git
synced 2025-12-18 19:50:17 +01:00
* initial ACER commit * Code cleanup + several fixes * Q-retrace bug fix + small clean-ups * added documentation for acer * ACER benchmarks * update benchmarks table * Add nightly running of golden and trace tests. (#202) Resolves #200 * comment out nightly trace tests until values reset. * remove redundant observe ignore (#168) * ensure nightly test env containers exist. (#205) Also bump integration test timeout * wxPython removal (#207) Replacing wxPython with Python's Tkinter. Also removing the option to choose multiple files as it is unused and causes errors, and fixing the load file/directory spinner. * Create CONTRIBUTING.md (#210) * Create CONTRIBUTING.md. Resolves #188 * run nightly golden tests sequentially. (#217) Should reduce resource requirements and potential CPU contention but increases overall execution time. * tests: added new setup configuration + test args (#211) - added utils for future tests and conftest - added test args * new docs build * golden test update
50 lines
2.1 KiB
Python
50 lines
2.1 KiB
Python
from rl_coach.agents.acer_agent import ACERAgentParameters
|
|
from rl_coach.base_parameters import VisualizationParameters, PresetValidationParameters
|
|
from rl_coach.core_types import TrainingSteps, EnvironmentEpisodes, EnvironmentSteps
|
|
from rl_coach.environments.gym_environment import GymVectorEnvironment
|
|
from rl_coach.filters.filter import InputFilter
|
|
from rl_coach.filters.reward.reward_rescale_filter import RewardRescaleFilter
|
|
from rl_coach.graph_managers.basic_rl_graph_manager import BasicRLGraphManager
|
|
from rl_coach.graph_managers.graph_manager import ScheduleParameters
|
|
from rl_coach.memories.memory import MemoryGranularity
|
|
|
|
####################
|
|
# Graph Scheduling #
|
|
####################
|
|
schedule_params = ScheduleParameters()
|
|
schedule_params.improve_steps = TrainingSteps(10000000000)
|
|
schedule_params.steps_between_evaluation_periods = EnvironmentEpisodes(10)
|
|
schedule_params.evaluation_steps = EnvironmentEpisodes(1)
|
|
schedule_params.heatup_steps = EnvironmentSteps(0)
|
|
|
|
#########
|
|
# Agent #
|
|
#########
|
|
agent_params = ACERAgentParameters()
|
|
|
|
agent_params.algorithm.num_steps_between_gradient_updates = 5
|
|
agent_params.algorithm.ratio_of_replay = 4
|
|
agent_params.algorithm.num_transitions_to_start_replay = 1000
|
|
agent_params.memory.max_size = (MemoryGranularity.Transitions, 50000)
|
|
agent_params.input_filter = InputFilter()
|
|
agent_params.input_filter.add_reward_filter('rescale', RewardRescaleFilter(1/200.))
|
|
agent_params.algorithm.beta_entropy = 0.0
|
|
|
|
###############
|
|
# Environment #
|
|
###############
|
|
env_params = GymVectorEnvironment(level='CartPole-v0')
|
|
|
|
########
|
|
# Test #
|
|
########
|
|
preset_validation_params = PresetValidationParameters()
|
|
preset_validation_params.test = True
|
|
preset_validation_params.min_reward_threshold = 150
|
|
preset_validation_params.max_episodes_to_achieve_reward = 300
|
|
preset_validation_params.num_workers = 1
|
|
|
|
graph_manager = BasicRLGraphManager(agent_params=agent_params, env_params=env_params,
|
|
schedule_params=schedule_params, vis_params=VisualizationParameters(),
|
|
preset_validation_params=preset_validation_params)
|