agent_params.network_wrappers['actor'].input_embedders_parameters.pop('observation') agent_params.network_wrappers['critic'].input_embedders_parameters['measurements'] = \ agent_params.network_wrappers['critic'].input_embedders_parameters.pop('observation') agent_params.network_wrappers['actor'].input_embedders_parameters[ 'measurements'].scheme = [Dense(300)] agent_params.network_wrappers['actor'].middleware_parameters.scheme = [ Dense(200) ] agent_params.network_wrappers['critic'].input_embedders_parameters[ 'measurements'].scheme = [Dense(400)] agent_params.network_wrappers['critic'].middleware_parameters.scheme = [ Dense(300) ] agent_params.network_wrappers['critic'].input_embedders_parameters[ 'action'].scheme = EmbedderScheme.Empty agent_params.input_filter = InputFilter() agent_params.input_filter.add_reward_filter("rescale", RewardRescaleFilter(1 / 10.)) ############### # Environment # ############### env_params = ControlSuiteEnvironmentParameters( level=SingleLevelSelection(control_suite_envs)) ######## # Test # ######## preset_validation_params = PresetValidationParameters() preset_validation_params.trace_test_levels = ['cartpole:swingup', 'hopper:hop']
schedule_params.heatup_steps = EnvironmentSteps(1000) ######### # Agent # ######### agent_params = DDPGAgentParameters() agent_params.network_wrappers['actor'].input_embedders_parameters['measurements'] = \ agent_params.network_wrappers['actor'].input_embedders_parameters.pop('observation') agent_params.network_wrappers['critic'].input_embedders_parameters['measurements'] = \ agent_params.network_wrappers['critic'].input_embedders_parameters.pop('observation') agent_params.network_wrappers['actor'].input_embedders_parameters['measurements'].scheme = [Dense([300])] agent_params.network_wrappers['actor'].middleware_parameters.scheme = [Dense([200])] agent_params.network_wrappers['critic'].input_embedders_parameters['measurements'].scheme = [Dense([400])] agent_params.network_wrappers['critic'].middleware_parameters.scheme = [Dense([300])] agent_params.network_wrappers['critic'].input_embedders_parameters['action'].scheme = EmbedderScheme.Empty agent_params.input_filter = MujocoInputFilter() agent_params.input_filter.add_reward_filter("rescale", RewardRescaleFilter(1/10.)) ############### # Environment # ############### env_params = ControlSuiteEnvironmentParameters() env_params.level = SingleLevelSelection(control_suite_envs) vis_params = VisualizationParameters() vis_params.video_dump_methods = [SelectedPhaseOnlyDumpMethod(RunPhase.TEST), MaxDumpMethod()] vis_params.dump_mp4 = False ######## # Test # ########
agent_params.network_wrappers['critic'].input_embedders_parameters['forward_camera'] = \ agent_params.network_wrappers['critic'].input_embedders_parameters.pop('observation') # left camera agent_params.network_wrappers['actor'].input_embedders_parameters['left_camera'] = \ copy.deepcopy(agent_params.network_wrappers['actor'].input_embedders_parameters['forward_camera']) agent_params.network_wrappers['critic'].input_embedders_parameters['left_camera'] = \ copy.deepcopy(agent_params.network_wrappers['critic'].input_embedders_parameters['forward_camera']) # right camera agent_params.network_wrappers['actor'].input_embedders_parameters['right_camera'] = \ copy.deepcopy(agent_params.network_wrappers['actor'].input_embedders_parameters['forward_camera']) agent_params.network_wrappers['critic'].input_embedders_parameters['right_camera'] = \ copy.deepcopy(agent_params.network_wrappers['critic'].input_embedders_parameters['forward_camera']) agent_params.input_filter = CarlaInputFilter() agent_params.input_filter.copy_filters_from_one_observation_to_another( 'forward_camera', 'left_camera') agent_params.input_filter.copy_filters_from_one_observation_to_another( 'forward_camera', 'right_camera') ############### # Environment # ############### env_params = CarlaEnvironmentParameters() env_params.cameras = [CameraTypes.FRONT, CameraTypes.LEFT, CameraTypes.RIGHT] graph_manager = BasicRLGraphManager(agent_params=agent_params, env_params=env_params, schedule_params=schedule_params, vis_params=VisualizationParameters())