예제 #1
0
파일: fqf.py 프로젝트: eeshakumar/bark-ml
def run_configuration(argv):
    params = ParameterServer()
    params["ML"]["BaseAgent"][
        "SummaryPath"] = "/home/mansoor/Study/Werkstudent/fortiss/code/bark-ml/summaries"
    params["ML"]["BaseAgent"][
        "CheckpointPath"] = "/home/mansoor/Study/Werkstudent/fortiss/code/bark-ml/checkpoints"

    env = gym.make(FLAGS.env, params=params)
    agent = FQFAgent(env=env, test_env=env, params=params)

    if FLAGS.load and params["ML"]["BaseAgent"]["CheckpointPath"]:
        agent.load_models(
            os.path.join(params["ML"]["BaseAgent"]["CheckpointPath"], "best"))

    if FLAGS.mode == "train":
        agent.train()

    elif FLAGS.mode == "visualize":
        agent.visualize()

    elif FLAGS.mode == "evaluate":
        # writes evaluaion data using summary writer in summary path
        agent.evaluate()

    else:
        raise Exception("Invalid argument for --mode")
예제 #2
0
 def test_agent_wrapping(self):
     params = ParameterServer()
     env = gym.make("highway-v1", params=params)
     env.reset()
     # agent = IQNAgent(env=env, test_env=env, params=params)
     params["ML"]["BaseAgent"]["MaxEpisodeSteps"] = 2
     params["ML"]["BaseAgent"]["NumEvalEpisodes"] = 2
     agent = FQFAgent(env=env, params=params)
     agent.train_episode()
     agent.evaluate()
예제 #3
0
 def test_agent_wrapping(self):
     params = ParameterServer()
     env = gym.make("highway-v1", params=params)
     env.reset()
     params["ML"]["BaseAgent"]["MaxEpisodeSteps"] = 2
     params["ML"]["BaseAgent"]["NumEvalEpisodes"] = 2
     train_bench = TrainingBenchmarkDatabase()
     agent = FQFAgent(env=env,
                      agent_save_dir="./save_dir",
                      params=params,
                      training_benchmark=train_bench)
     agent.train_episode()
     agent.evaluate()