Exemplo n.º 1
0
def run_dqn_algorithm(parameter_files):
    exp_dir = "tmp_exp_dir"
    diadem_params = Params(filename=parameter_files)
    environment = DiademBarkEnvironment(runtime=runtime)
    context = AgentContext(environment=environment,
                           datamanager=None,
                           preprocessor=None,
                           optimizer=tf.train.AdamOptimizer,
                           summary_service=ConsoleSummary())
    agent = AgentManager(params=diadem_params, context=context)
    exp = Experiment(params=diadem_params['experiment'],
                     main_dir=exp_dir,
                     context=context,
                     agent=agent,
                     visualizer=None)
    exp.run()
Exemplo n.º 2
0
def run_dqn_algorithm(parameter_files):
    exp_dir = "tmp_exp_dir"
    params = Params(filename=parameter_files)
    environment = BarkHighway(params=params['environment'])
    context = AgentContext(environment=environment,
                           datamanager=None,
                           preprocessor=Normalization(environment=environment),
                           optimizer=tf.train.AdamOptimizer,
                           summary_service=PandasSummary())
    agent = AgentManager(params=params, context=context)

    exp = Experiment(params=params['experiment'],
                     main_dir=exp_dir,
                     context=context,
                     agent=agent,
                     visualizer=None)
    exp.run()
Exemplo n.º 3
0
def main():
    exp_dir = "tmp_exp_dir"
    params = Params(filename=[
        "examples/example_params/common_parameters.yaml",
        "examples/example_params/online_rendering.yaml"
    ])
    environment = GymEnvironment(params=params['environment'])
    context = AgentContext(environment=environment,
                           datamanager=None,
                           preprocessor=Normalization(environment=environment),
                           optimizer=tf.train.AdamOptimizer,
                           summary_service=ConsoleSummary())
    agent = AgentManager(params=params, context=context)

    exp = Experiment(params=params['experiment'],
                     main_dir=exp_dir,
                     context=context,
                     agent=agent,
                     visualizer=OnlineVisualizer(
                         params=params['visualization'], context=context))
    exp.run()