parser.add_argument('--ct_kernel', default=0, type=int)     # 0 for Gibbs, 1 for MH
    parser.add_argument('--no_plots', action='store_true')

    return parser

if __name__ == "__main__":
    import argparse
    import experiment_runner.experiment_utils as eru
    from experiment_runner.ExperimentRunner import ExperimentRunner, propagate_to_s3 

    parser = gen_parser()
    args = parser.parse_args()

    argsdict = eu.parser_args_to_dict(args)
    generate_plots = not argsdict['no_plots']

    results_filename = 'recovers_original_densities_results'
    dirname_prefix = 'recovers_original_densities'

    er = ExperimentRunner(run_experiment, dirname_prefix=dirname_prefix, bucket_str='experiment_runner', storage_type='fs')
    er.do_experiments([argsdict])

    if generate_plots:
        for id in er.frame.index:
            result = er._get_result(id)
            this_dirname = eru._generate_dirname(dirname_prefix, 10, result['config'])
            filename_img = os.path.join(dirname_prefix, this_dirname, results_filename+'.png')
            eu.plot_recovers_original_densities(result, filename=filename_img)
            pass
        pass
Exemple #2
0
    return

def plot_results(frame, save=True, plot_prefix=None, dirname='./'):
    # generate each type of plot
    filter_join = lambda join_with, list: join_with.join(filter(None, list))
    for vary_what in ['rows', 'cols', 'clusters', 'views']:
        plot_filename = filter_join('_', [plot_prefix, 'vary', vary_what])
        _plot_results(frame, vary_what, plot_filename)
        if save:
            pu.savefig_legend_outside(plot_filename, dir=dirname)
            pass
        pass
    return

if __name__ == '__main__':
    from experiment_runner.ExperimentRunner import ExperimentRunner


    config_list = gen_configs(
            kernel_list = _kernel_list,
            num_rows=[10, 100],
            )


    dirname = 'timing_analysis'
    er = ExperimentRunner(runner, dirname_prefix=dirname)
    er.do_experiments(config_list, dirname)
    print er.frame

    results_dict = er.get_results(er.frame[er.frame.same_shape])
Exemple #3
0
    do_plots = not args.no_plots
    do_long = args.do_long
    _divisor = args._divisor


    # create configs
    arg_list_to_config = partial(eu.arg_list_to_config,
            geweke_utils.generate_parser(),
            arbitrate_args=geweke_utils.arbitrate_args)
    args_list = generate_args_list(base_num_rows, num_iters, do_long, _divisor)
    config_list = map(arg_list_to_config, args_list)


    # do experiments
    er = ExperimentRunner(geweke_utils.run_geweke, storage_type='fs',
            dirname_prefix=dirname,
            bucket_str='experiment_runner')
    er.do_experiments(config_list)
    # push to s3
    propagate_to_s3(er)


    if do_plots:
        for id in er.frame.index:
            result = er._get_result(id)
            geweke_utils.plot_result(result, dirname)
            pass
        pass

    print er.frame
    return


if __name__ == '__main__':
    from experiment_runner.ExperimentRunner import ExperimentRunner, propagate_to_s3

    # parse args
    parser = _generate_parser()
    args = parser.parse_args()
    kwargs, do_plots, dirname = _munge_args(args)

    # create configs
    config_list = eu.gen_configs(base_config, **kwargs)

    # do experiments
    er = ExperimentRunner(
        runner,
        storage_type='fs',
        dirname_prefix=dirname,
        bucket_str='experiment_runner',
    )
    er.do_experiments(config_list)
    propagate_to_s3(er)

    if do_plots:
        results = er.get_results(er.frame).values()
        summary_plotter(results, dirname=dirname)
#        eu.plot_results(plotter, results, generate_dirname,
#                saver=pu.save_current_figure, filename='over_iters',
#                dirname=dirname)
    from experiment_runner.ExperimentRunner import ExperimentRunner, propagate_to_s3


    # parse args
    parser = _generate_parser()
    args = parser.parse_args()
    kwargs, dirname, plot_prefix, generate_plots = _munge_args(args)


    # create configs
    config_list = ttu.gen_configs(
            kernel_list = ttu._kernel_list,
            n_steps=[10],
            **kwargs
            )


    # do experiments
    er = ExperimentRunner(ttu.runner, storage_type='fs',
            dirname_prefix=dirname,
            bucket_str='experiment_runner')
    with Timer('er.do_experiments') as timer:
        er.do_experiments(config_list)
        pass
    # push to s3
    propagate_to_s3(er)


    if generate_plots:
        ttu.plot_results(er.frame, plot_prefix=plot_prefix, dirname=dirname)
Exemple #6
0
    import argparse
    import experiment_runner.experiment_utils as eru
    from experiment_runner.ExperimentRunner import ExperimentRunner, propagate_to_s3 

    parser = gen_parser()
    args = parser.parse_args()

    argsdict = eu.parser_args_to_dict(args)
    generate_plots = not argsdict['no_plots']

    use_runner = not argsdict['no_runner']

    results_filename = 'haystacks_break_results'
    dirname_prefix = 'haystacks_break'

    er = ExperimentRunner(run_experiment, dirname_prefix=dirname_prefix, bucket_str='experiment_runner', storage_type='fs')

    if use_runner:
        er.do_experiments([argsdict], do_multiprocessing=False)

        if generate_plots:
            for id in er.frame.index:
                result = er._get_result(id)
                this_dirname = eru._generate_dirname(dirname_prefix, 10, result['config'])
                filename_img = os.path.join(dirname_prefix, this_dirname, results_filename+'.png')
                eu.plot_haystacks_break(result, filename=filename_img)
                pass
    else:
        result = run_experiment(argsdict)

    	if generate_plots:

if __name__ == '__main__':
    from experiment_runner.ExperimentRunner import ExperimentRunner, propagate_to_s3

    # parse args
    parser = _generate_parser()
    args = parser.parse_args()
    kwargs, do_plots, dirname = _munge_args(args)


    # create configs
    config_list = eu.gen_configs(base_config, **kwargs)


    # do experiments
    er = ExperimentRunner(runner, storage_type='fs',
            dirname_prefix=dirname,
            bucket_str='experiment_runner',
            )
    er.do_experiments(config_list)
    propagate_to_s3(er)


    if do_plots:
        results = er.get_results(er.frame).values()
        summary_plotter(results, dirname=dirname)
#        eu.plot_results(plotter, results, generate_dirname,
#                saver=pu.save_current_figure, filename='over_iters',
#                dirname=dirname)

if __name__ == '__main__':
    import crosscat.tests.timing_test_utils as ttu
    from crosscat.utils.general_utils import Timer
    from experiment_runner.ExperimentRunner import ExperimentRunner, propagate_to_s3

    # parse args
    parser = _generate_parser()
    args = parser.parse_args()
    kwargs, dirname, plot_prefix, generate_plots = _munge_args(args)

    # create configs
    config_list = ttu.gen_configs(kernel_list=ttu._kernel_list,
                                  n_steps=[10],
                                  **kwargs)

    # do experiments
    er = ExperimentRunner(ttu.runner,
                          storage_type='fs',
                          dirname_prefix=dirname,
                          bucket_str='experiment_runner')
    with Timer('er.do_experiments') as timer:
        er.do_experiments(config_list)
        pass
    # push to s3
    propagate_to_s3(er)

    if generate_plots:
        ttu.plot_results(er.frame, plot_prefix=plot_prefix, dirname=dirname)