def main(collect): collect = misc.update_arguments(collect=collect)[0] dataset_dir, env_name, episodes = collect_dataset(collect) print( colored('Dataset successfully written to {}'.format(dataset_dir), 'green')) print( colored('{} episodes collected from {}'.format(episodes, env_name), 'green'))
def main(model, dataset): model, dataset = misc.update_arguments(model=model, dataset=dataset) train_loader, eval_loader, env_name, statistics = utils.make_loader( model=model, dataset=dataset) net, optimizer, starting_epoch, net_path = utils.make_net( model=model, dataset=dataset, env_name=env_name, statistics=statistics) utils.write_info(model, dataset) log.init_writers(net_path) train(train_loader, eval_loader, net_path, net, optimizer, starting_epoch)
def main(model, collect): t0 = time.time() print('Collecting demos in folder {} with parameters:\n collect {}\n model {}'.format( collect['folder'], collect, model)) model, collect = misc.update_arguments(model=model, collect=collect) collector, seed_epoch, report, report_path, data_dir = make_collector(model, collect) results = run_parallel(collector, seed_epoch, collect) episodes, failed_episodes, tot_steps, max_steps = process_results( results, report, report_path, collect) print(colored('Dataset successfully written to {}'.format(data_dir), 'green')) print(colored('Total {} steps in {} trajectories'.format(tot_steps, episodes), 'green')) print(colored('Maximum {} steps in one trajectory'.format(max_steps), 'green')) print(colored('Data collection took {} seconds'.format(time.time() - t0), 'green')) # if len(failed_episodes): # print(colored('Failed {} trajectories: {}'.format( # len(failed_episodes), sorted(failed_episodes)), 'red')) if report is not None: print_report(report)
def main(sim2real, train, dataset, model): model, dataset, sim2real = misc.update_arguments(model=model, dataset=dataset, sim2real=sim2real) utils.set_up_training(sim2real['mcts_dir']) train_mcts(train=train, dataset=dataset, model=model, **sim2real)