Skip to content
This repository has been archived by the owner on Dec 11, 2022. It is now read-only.

A3C presets for ControlSuite #146

Open
KeAWang opened this issue Dec 10, 2018 · 2 comments
Open

A3C presets for ControlSuite #146

KeAWang opened this issue Dec 10, 2018 · 2 comments
Labels
priority/p2 questions needing answered or medium impact bugs
Projects

Comments

@KeAWang
Copy link

KeAWang commented Dec 10, 2018

Following the settings in rl_coach/presets/Mujoco_PPO.py and rl_coach/presets/ControlSuite_DDPG.py, I'm creating my own presets to run A3C on ControlSuite with the following preset ControlSuite_A3C.py file:

from rl_coach.agents.actor_critic_agent import ActorCriticAgentParameters
from rl_coach.base_parameters import VisualizationParameters, PresetValidationParameters
from rl_coach.core_types import TrainingSteps, EnvironmentEpisodes, EnvironmentSteps
from rl_coach.environments.control_suite_environment import ControlSuiteEnvironmentParameters, control_suite_envs
from rl_coach.environments.environment import SingleLevelSelection
from rl_coach.filters.filter import InputFilter
from rl_coach.filters.observation.observation_normalization_filter import ObservationNormalizationFilter
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

####################
# 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 = ActorCriticAgentParameters()
agent_params.algorithm.apply_gradients_every_x_episodes = 1
agent_params.algorithm.num_steps_between_gradient_updates = 10000000
agent_params.algorithm.beta_entropy = 0.0001
agent_params.network_wrappers['main'].learning_rate = 0.00001

agent_params.input_filter = InputFilter()
agent_params.input_filter.add_reward_filter('rescale', RewardRescaleFilter(1/20.))
agent_params.input_filter.add_observation_filter('observation', 'normalize', ObservationNormalizationFilter())

###############
# Environment #
###############
env_params = ControlSuiteEnvironmentParameters(level=SingleLevelSelection(control_suite_envs))

########
# Test #
########
preset_validation_params = PresetValidationParameters()
preset_validation_params.trace_test_levels = ['cartpole:swingup', 'hopper:hop']
preset_validation_params.test = True
preset_validation_params.min_reward_threshold = 400
preset_validation_params.max_episodes_to_achieve_reward = 1000
preset_validation_params.num_workers = 8

graph_manager = BasicRLGraphManager(agent_params=agent_params, env_params=env_params,
                                    schedule_params=schedule_params, vis_params=VisualizationParameters(),
                                    preset_validation_params=preset_validation_params)

However, running python rl_coach/coach.py -p ControlSuite_A3C -lvl cartpole:swingup in the command line keeps returning the error ValueError: The key for the input embedder (observation) must match one of the following keys: dict_keys(['measurements', 'action', 'goal']).

I'm not trying to access the keys of the input embedder in my preset above at all so I'm not sure why I get this error. How can I fix this issue?

@KeAWang KeAWang changed the title A3C presets Dec 10, 2018
@scttl scttl added this to To do in Coach Dev Jan 11, 2019
@galnov galnov added the priority/p2 questions needing answered or medium impact bugs label Jan 16, 2019
@scttl scttl moved this from Requires Grooming to Groomed but Not Started in Coach Dev Jan 17, 2019
@ujjawalchugh97
Copy link

@KeAWang I'm facing the same issue on a different preset. Were you able to solve this?

@ujjawalchugh97
Copy link

@scttl any update on this?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
priority/p2 questions needing answered or medium impact bugs
3 participants