def main(args): a_args = (args.pip, args.pport, args.fsm_config,) a_args += ("usermodule", True, None, {"filename": args.file, "append": args.append}, ConfigMgr(args.user_config, "pygame", eval_key=True),) client = None if args.client == 'webots': client = WebotsClient() if args.exp == "penaltykick": run(PenaltyKickEnvironment, PenaltyKickAgent, EpisodicExperiment, env_args=(args.feature_rep, args.support_leg, client,), agent_args=a_args, exp_kwargs={'nepisodes': args.nepisodes}, local=args.local) elif args.exp == "bodymotion": run(BodyMotionEnvironment, BodyMotionAgent, EpisodicExperiment, env_args=(args.feature_rep, client,), agent_args=a_args, exp_kwargs={'nepisodes': args.nepisodes}, local=args.local)
def main(args): if args.single_pole: if args.friction: # single pole with friction run(CartPole, ModelBasedAgent, EpisodicExperiment, env_args=('custom', [.5], [.1], 10), env_kwargs={'random_start': False, 'cart_loc': [-2.4, 2.4], 'cart_vel': [-np.inf, np.inf], 'pole_angle': [-36, 36], 'pole_vel': [-np.inf, np.inf], 'mu_c': 0.0005, 'mu_p': 0.000002, 'discount_factor': 0.99}, agent_args=('learningmodule', False, None, None, None, 'cacla', 0, 40), agent_kwargs={'alpha': 0.001, 'beta': 0.001}, exp_args=(1, 1000, 1000), exp_kwargs={'filename': args.file}, local=True) else: run(CartPole, ModelBasedAgent, EpisodicExperiment, env_args=('custom', [.5], [.1], 10), env_kwargs={'random_start': False, 'cart_loc': [-2.4, 2.4], 'cart_vel': [-np.inf, np.inf], 'pole_angle': [-36, 36], 'pole_vel': [-np.inf, np.inf], 'mu_c': 0.0005, 'mu_p': 0.000002, 'discount_factor': 0.99, 'include_friction': False}, agent_args=('learningmodule', False, None, None, None, 'cacla', 0, 40), agent_kwargs={'alpha': 0.001, 'beta': 0.001}, exp_args=(1, 500, 1000), exp_kwargs={'filename': args.file}, local=True) else: # double pole with friction run(CartPole, ModelBasedAgent, EpisodicExperiment, env_args=('custom', [1., .1], [.1, .01], 10), env_kwargs={'discrete_action': False, 'random_start': True, 'cart_loc': [-2.4, 2.4], 'cart_vel': [-np.inf, np.inf], 'pole_angle': [-36., 36.], 'pole_vel': [-np.inf, np.inf], 'mu_c': 0.0005, 'mu_p': 0.000002, 'discount_factor': 0.99}, agent_args=('learningmodule', False, None, None, None, 'cacla', 0, 40), agent_kwargs={'alpha': 0.001, 'beta': 0.001}, exp_args=(1, 200000, 1000), exp_kwargs={'filename': args.file}, local=True)
{"filename": args.infile, "append": args.append}, args.learner, np.asarray(demo), ValueIteration(model, explorer, args.gamma, args.ignore_unreachable), ) a_kwargs = {"filename": args.savefile, "progress": args.progress} client = None if args.client == "webots": client = WebotsClient() run( PenaltyKickEnvironment, PenaltyKickAgent, EpisodicExperiment, env_args=(args.feature_rep, args.support_leg, client), agent_args=a_args, agent_kwargs=a_kwargs, local=args.local, ) if __name__ == "__main__": ap = argparse.ArgumentParser(description="Experiment: Emulate the behavior via inverse reinforcement learning.") ap.add_argument( "--local", action="store_false", help="When true, the experiment is run through a local RLGlue implementation." ) ap.add_argument("--progress", action="store_true", help="When true, a previously saved trial will be continued.") ap.add_argument( "--keep_history", action="store_true",
sys.exit(sys.exc_info()[1]) except KeyError, e: sys.exit("Key not found: {0}".format(e)) a_args = (args.pip, args.pport, args.fsm_config,) a_args += ("followpolicymodule", True, None, {"filename": args.file, "append": args.append}, policies,) client = None if args.client == 'webots': client = WebotsClient() if args.exp == "penaltykick": run(PenaltyKickEnvironment, PenaltyKickAgent, EpisodicExperiment, env_args=(args.feature_rep, args.support_leg, client,), agent_args=a_args, exp_kwargs={'ntrials': args.ntrials, 'nepisodes': args.nepisodes}, local=args.local) elif args.exp == "bodymotion": run(BodyMotionEnvironment, BodyMotionAgent, EpisodicExperiment, env_args=(args.feature_rep, client,), agent_args=a_args, exp_kwargs={'ntrials': args.ntrials, 'nepisodes': args.nepisodes}, local=args.local) if __name__ == "__main__": ap = argparse.ArgumentParser(description="Gather observation data for the given task from the NAO robot.") ap.add_argument("--local", action="store_false", help="When true, the experiment is run through a local RLGlue implementation.") ap.add_argument("--append", action="store_true",