Пример #1
0
            time_elapsed = time.time() - training_start_timestamp
            message = (
                f"Time elapsed: {time_elapsed // 60:.0f}m {time_elapsed % 60:.0f}s"
            )
            print(f'\n{"-" * 9} {message} {"-" * 9}\n')

            agent.save(C)
            save_snapshot()


if __name__ == "__main__":
    import neodroidagent.configs.curriculum.curriculum_config as C

    from neodroidagent.configs import parse_arguments

    config = parse_arguments("PG Agent", C)

    for key, arg in config.__dict__.items():
        setattr(C, key, arg)

    sprint(f"\nUsing config: {C}\n", highlight=True, color="yellow")
    if not config.skip_confirmation:
        for key, arg in get_upper_case_vars_or_protected_of(C).items():
            print(f"{key} = {arg}")
        input("\nPress Enter to begin... ")

    _agent = PolicyGradientAgent(C)
    # _agent = DDPGAgent(C)
    # _agent = DQNAgent(C)

    try:
Пример #2
0
        config_name=C.CONFIG_NAME,
        project_name=C.PROJECT,
    )
    U.save_model(trained_model, **config)

    env.close()


if __name__ == "__main__":

    from neodroidagent.configs import (
        parse_arguments,
        get_upper_case_vars_or_protected_of,
    )

    config = parse_arguments("Regular small grid world experiment", C)

    for key, arg in config.__dict__.items():
        setattr(C, key, arg)

    draugr.sprint(f"\nUsing config: {C}\n", highlight=True, color="yellow")
    if not config.skip_confirmation:
        for key, arg in get_upper_case_vars_or_protected_of(C).items():
            print(f"{key} = {arg}")
        input("\nPress Enter to begin... ")

    _agent = C.AGENT_TYPE(C)

    try:
        train_agent(C, _agent)
    except KeyboardInterrupt:
Пример #3
0
        project_name=C.PROJECT_NAME,
    )
    U.save_model(trained_model, **config)

    env.close()


if __name__ == "__main__":
    import neodroidagent.configs.agent_test_configs.ddpg_test_config as C

    from neodroidagent.configs import (
        parse_arguments,
        get_upper_case_vars_or_protected_of,
    )

    config = parse_arguments("Manipulator experiment", C)

    for key, arg in config.__dict__.items():
        setattr(C, key, arg)

    sprint(f"\nUsing config: {C}\n", highlight=True, color="yellow")
    if not config.skip_confirmation:
        for key, arg in get_upper_case_vars_or_protected_of(C).items():
            print(f"{key} = {arg}")
        input("\nPress Enter to begin... ")

    _agent = C.AGENT(C)

    try:
        train_agent(C, _agent)
    except KeyboardInterrupt:
Пример #4
0
        project_name=C.PROJECT,
    )
    U.save_model(trained_model, **config)

    env.close()


if __name__ == "__main__":
    import experiments.rl.continuous.c2d_config as C

    from neodroidagent.configs import (
        parse_arguments,
        get_upper_case_vars_or_protected_of,
    )

    config = parse_arguments("C2D", C)

    for key, arg in config.__dict__.items():
        setattr(C, key, arg)

    draugr.sprint(f"\nUsing config: {C}\n", highlight=True, color="yellow")
    if not config.skip_confirmation:
        for key, arg in get_upper_case_vars_or_protected_of(C).items():
            print(f"{key} = {arg}")
        input("\nPress Enter to begin... ")

    _agent = C.AGENT_TYPE(C)

    try:
        train_agent(C, _agent)
    except KeyboardInterrupt:
Пример #5
0
        project_name=C.PROJECT,
    )
    U.save_model(trained_model, **config)

    env.close()


if __name__ == "__main__":
    import experiments.rl.grid_world.grid_world_config as C

    from neodroidagent.configs import (
        parse_arguments,
        get_upper_case_vars_or_protected_of,
    )

    config = parse_arguments("Curriculum grid world experiment", C)

    for key, arg in config.__dict__.items():
        setattr(C, key, arg)

    sprint(f"\nUsing config: {C}\n", highlight=True, color="yellow")
    if not config.skip_confirmation:
        for key, arg in get_upper_case_vars_or_protected_of(C).items():
            print(f"{key} = {arg}")
        input("\nPress Enter to begin... ")

    _agent = C.AGENT_TYPE(C)

    try:
        train_agent(C, _agent)
    except KeyboardInterrupt: