Exemplo n.º 1
0
def main():
    args = parse_cli()
    config = yread(args.conf)
    config['experiment_name'] = {}

    clfs, param_space, _ = get_param_space()
    for clf_name in clfs:

        print("processing {}".format(clf_name))
        # sampling max_evals parameters
        param_iter = ParameterSampler(param_space[clf_name], n_iter=config['max_evals'])

        # create the database collection's skeleton
        experiment_name = param_space_to_experiment_name(clf_name, user.param_space[clf_name])

        jobs = JobsDB(config['project_name'], experiment_name,
                      host=config['MongoDB']['host'],
                      port=config['MongoDB']['port'])
		      
        jobs.create_jobs(config['features'], param_iter)

        # collect database collection's name
        config['experiment_name'][clf_name] = experiment_name

    # add collection's info to config.
    ywrite(config, args.save)
Exemplo n.º 2
0
def main():
    args = parse_cli()
    config = yread(args.conf)
    config['experiment_name'] = {}

    clfs, param_space, _ = get_param_space()
    for clf_name in clfs:

        print("processing {}".format(clf_name))
        # sampling max_evals parameters
        param_iter = ParameterSampler(param_space[clf_name],
                                      n_iter=config['max_evals'])

        # create the database collection's skeleton
        experiment_name = param_space_to_experiment_name(
            clf_name, user.param_space[clf_name])

        jobs = JobsDB(config['project_name'],
                      experiment_name,
                      host=config['MongoDB']['host'],
                      port=config['MongoDB']['port'])

        jobs.create_jobs(config['features'], param_iter)

        # collect database collection's name
        config['experiment_name'][clf_name] = experiment_name

    # add collection's info to config.
    ywrite(config, args.save)
Exemplo n.º 3
0
def main():
    args = parse_cli()
    config = yread(args.configure)
    config['experiment_name'] = {}

    param_space = get_param_space()
    meta_param = list(param_space.keys())
    for clf_name in meta_param:

        print("processing {}".format(clf_name))
        # sampling max_evals parameters
        param_iter = ParameterSampler(param_space[clf_name], n_iter=config['max_evals'])

        # create the database collection's skeleton
        experiment_name = clf_name + ':' + chain_dict_keys(param_space[clf_name])
        jobs = JobsDB(config['project_name'], experiment_name,
                      host=config['MongoDB']['host'],
                      port=config['MongoDB']['port'])
        jobs.create_jobs(config['features'], param_iter)

        # collect database collection's name
        config['experiment_name'][clf_name] = experiment_name

    # add collection's info to config.
    ywrite(config, args.save)
Exemplo n.º 4
0
def main():
    args = parse_cli()
    config = yread(args.conf)

    w = Worker(config['project_name'],
               config['experiment_name'],
               objective_random_sleep,
               host=config['MongoDB']['host'],
               port=config['MongoDB']['port'],
               loop_forever=args.loop)

    # do the tasks
    w.start_worker()
Exemplo n.º 5
0
def main():
    args = parse_cli()
    config = yread(args.conf)

    # sample parameters
    param_space = get_param_space()
    param_iter = ParameterSampler(param_space, n_iter=config['number_examples'])

    # create MongoDB collection
    jobs = JobsDB(config['project_name'],
                  config['experiment_name'],
                  host=config['MongoDB']['host'],
                  port=config['MongoDB']['port'])
    jobs.create_jobs(None, param_iter)
Exemplo n.º 6
0
def main():
    args = parse_cli()
    config = yread(args.conf)

    # sample parameters
    param_space = get_param_space()
    param_iter = ParameterSampler(param_space,
                                  n_iter=config['number_examples'])

    # create MongoDB collection
    jobs = JobsDB(config['project_name'],
                  config['experiment_name'],
                  host=config['MongoDB']['host'],
                  port=config['MongoDB']['port'])
    jobs.create_jobs(None, param_iter)
Exemplo n.º 7
0
def main():
    args = parse_cli()
    config = yread(args.conf)
    # connect to collection
    jobs = JobsDB(config['project_name'],
                  config['experiment_name'],
                  host=config['MongoDB']['host'],
                  port=config['MongoDB']['port'])

    jobs.print_job_stats()

    # TODO: need to introduce a Results class to handle this stuff...
    # we'll use the results multiple times, so cache it (TODO: catch OOM)
    completed = list(jobs.get_completed_jobs())
    for idx, trial in enumerate(completed):
        print 'Trial #{}: params: {} / results: {} / run-on: {}'.format(idx, 
               trial['params'], trial['aux_data'], trial['owner'])
Exemplo n.º 8
0
def main():
    args = parse_cli()
    config = yread(args.conf)
    # connect to collection
    jobs = JobsDB(config['project_name'],
                  config['experiment_name'],
                  host=config['MongoDB']['host'],
                  port=config['MongoDB']['port'])

    jobs.print_job_stats()

    # TODO: need to introduce a Results class to handle this stuff...
    # we'll use the results multiple times, so cache it (TODO: catch OOM)
    completed = list(jobs.get_completed_jobs())
    for idx, trial in enumerate(completed):
        print 'Trial #{}: params: {} / results: {} / run-on: {}'.format(
            idx, trial['params'], trial['aux_data'], trial['owner'])
Exemplo n.º 9
0
def main():
    args = parse_cli()
    config = yread(args.conf)
    for clf, db_collection in config['experiment_name'].items():
        print('\nProcessing {}, experiment name: {}'.format(
            clf, db_collection))
        p = Plotting(config['project_name'], db_collection,
                     user.param_space[clf], user.param_types[clf])

        print('\nPlotting loss vs time')
        p.plot_loss_vs_time()

        for param in p.param_names:
            print('\nPlotting loss vs. {}'.format(param))
            p.plot_loss_vs_param(param)

        print('\nPlotting loss vs. two best params')
        p.plot_loss_vs_param()
Exemplo n.º 10
0
def main():
    args = parse_cli()
    config = yread(args.configure)
    for clf, db_collection in config['experiment_name'].items():
        p = Plotting(config['project_name'],
                     clf + ':' + db_collection,
                     user.param_space[clf],
                     user.param_types[clf])

    print('plotting loss vs time')
    p.plot_loss_vs_time()

    for param in p.param_names:
        print('plotting loss vs {}'.format(param))
        p.plot_loss_vs_param(param)

    print('plotting loss vs two params')
    p.plot_loss_vs_param()
Exemplo n.º 11
0
def main():
    args = parse_cli()
    config = yread(args.conf)
    for clf, db_collection in config['experiment_name'].items():
        print('\nProcessing {}, experiment name: {}'.format(clf, db_collection))
        p = Plotting(config['project_name'],
                     db_collection,
                     user.param_space[clf],
                     user.param_types[clf])

        print('\nPlotting loss vs time')
        p.plot_loss_vs_time()
    
        for param in p.param_names:
            print('\nPlotting loss vs. {}'.format(param))
            p.plot_loss_vs_param(param)

        print('\nPlotting loss vs. two best params')
        p.plot_loss_vs_param()
Exemplo n.º 12
0
def main():
    args = parse_cli()
    config = yread(args.configure)
    config["experiment_name"] = {}

    clfs, param_space, _ = get_param_space()
    for clf_name in clfs:

        print("processing {}".format(clf_name))
        # sampling max_evals parameters
        param_iter = ParameterSampler(param_space[clf_name], n_iter=config["max_evals"])

        # create the database collection's skeleton
        experiment_name = clf_name + ":" + chain_dict_keys(param_space[clf_name])
        jobs = JobsDB(
            config["project_name"], experiment_name, host=config["MongoDB"]["host"], port=config["MongoDB"]["port"]
        )
        jobs.create_jobs(config["features"], param_iter)

        # collect database collection's name
        config["experiment_name"][clf_name] = experiment_name

    # add collection's info to config.
    ywrite(config, args.save)