mirror of
https://github.com/gryf/coach.git
synced 2025-12-17 19:20:19 +01:00
human agent will exit when human control not supported by environment; jupyter notebooks fixes
This commit is contained in:
@@ -329,6 +329,8 @@ class GymEnvironment(Environment):
|
|||||||
self.key_to_action = {}
|
self.key_to_action = {}
|
||||||
if hasattr(self.env.unwrapped, 'get_keys_to_action'):
|
if hasattr(self.env.unwrapped, 'get_keys_to_action'):
|
||||||
self.key_to_action = self.env.unwrapped.get_keys_to_action()
|
self.key_to_action = self.env.unwrapped.get_keys_to_action()
|
||||||
|
else:
|
||||||
|
screen.error("Error: Environment {} does not support human control.".format(self.env), crash=True)
|
||||||
|
|
||||||
# initialize the state by getting a new state from the environment
|
# initialize the state by getting a new state from the environment
|
||||||
self.reset_internal_state(True)
|
self.reset_internal_state(True)
|
||||||
|
|||||||
@@ -348,7 +348,7 @@
|
|||||||
"metadata": {},
|
"metadata": {},
|
||||||
"source": [
|
"source": [
|
||||||
"# Running the Preset\n",
|
"# Running the Preset\n",
|
||||||
"(this is normally done from command line by running ```python coach.py -p atari_categorical_dqn ... ```)"
|
"(this is normally done from command line by running ```coach -p Atari_C51 ... ```)"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -28,7 +28,7 @@
|
|||||||
"outputs": [],
|
"outputs": [],
|
||||||
"source": [
|
"source": [
|
||||||
"import os\n",
|
"import os\n",
|
||||||
"os.environ['DISABLE_MUJOCO_RENDERING'] = '1'\n",
|
"#os.environ['DISABLE_MUJOCO_RENDERING'] = '1'\n",
|
||||||
"\n",
|
"\n",
|
||||||
"import sys\n",
|
"import sys\n",
|
||||||
"module_path = os.path.abspath(os.path.join('..'))\n",
|
"module_path = os.path.abspath(os.path.join('..'))\n",
|
||||||
@@ -334,7 +334,7 @@
|
|||||||
" schedule_params=schedule_params, vis_params=vis_params)\n",
|
" schedule_params=schedule_params, vis_params=vis_params)\n",
|
||||||
"\n",
|
"\n",
|
||||||
"graph_manager.env_params.level.select('walker:walk')\n",
|
"graph_manager.env_params.level.select('walker:walk')\n",
|
||||||
"#graph_manager.visualization_parameters.render = True\n",
|
"graph_manager.visualization_parameters.render = True\n",
|
||||||
"\n",
|
"\n",
|
||||||
"\n",
|
"\n",
|
||||||
"log_path = '../experiments/control_suite_walker_ddpg'\n",
|
"log_path = '../experiments/control_suite_walker_ddpg'\n",
|
||||||
|
|||||||
@@ -163,7 +163,8 @@
|
|||||||
"outputs": [],
|
"outputs": [],
|
||||||
"source": [
|
"source": [
|
||||||
"from rl_coach.architectures.tensorflow_components.architecture import Dense\n",
|
"from rl_coach.architectures.tensorflow_components.architecture import Dense\n",
|
||||||
"from rl_coach.base_parameters import VisualizationParameters, EmbeddingMergerType, EmbedderScheme, InputEmbedderParameters\n",
|
"from rl_coach.base_parameters import VisualizationParameters, EmbeddingMergerType, EmbedderScheme\n",
|
||||||
|
"from rl_coach.architectures.tensorflow_components.embedders.embedder import InputEmbedderParameters\n",
|
||||||
"from rl_coach.memories.episodic.episodic_hindsight_experience_replay import HindsightGoalSelectionMethod, \\\n",
|
"from rl_coach.memories.episodic.episodic_hindsight_experience_replay import HindsightGoalSelectionMethod, \\\n",
|
||||||
" EpisodicHindsightExperienceReplayParameters\n",
|
" EpisodicHindsightExperienceReplayParameters\n",
|
||||||
"from rl_coach.memories.episodic.episodic_hrl_hindsight_experience_replay import \\\n",
|
"from rl_coach.memories.episodic.episodic_hrl_hindsight_experience_replay import \\\n",
|
||||||
@@ -344,7 +345,8 @@
|
|||||||
"source": [
|
"source": [
|
||||||
"graph_manager = HRLGraphManager(agents_params=agents_params, env_params=env_params,\n",
|
"graph_manager = HRLGraphManager(agents_params=agents_params, env_params=env_params,\n",
|
||||||
" schedule_params=schedule_params, vis_params=vis_params,\n",
|
" schedule_params=schedule_params, vis_params=vis_params,\n",
|
||||||
" consecutive_steps_to_run_each_level=EnvironmentSteps(40))"
|
" consecutive_steps_to_run_each_level=EnvironmentSteps(40))\n",
|
||||||
|
"graph_manager.visualization_parameters.render = True"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -360,7 +362,7 @@
|
|||||||
"metadata": {},
|
"metadata": {},
|
||||||
"outputs": [],
|
"outputs": [],
|
||||||
"source": [
|
"source": [
|
||||||
"from base_parameters import TaskParameters, Frameworks\n",
|
"from rl_coach.base_parameters import TaskParameters, Frameworks\n",
|
||||||
"\n",
|
"\n",
|
||||||
"log_path = '../experiments/pendulum_hac'\n",
|
"log_path = '../experiments/pendulum_hac'\n",
|
||||||
"if not os.path.exists(log_path):\n",
|
"if not os.path.exists(log_path):\n",
|
||||||
|
|||||||
Reference in New Issue
Block a user