Example #1
0
def web_model_results(dir_path):
    for noise in ['0.01', '0.05', '0.1']:
        for bottleneck in ['1', '2', '3', '4']:
            for exposures in ['1', '2', '3', '4']:
                figure_path = dir_path + '%s_%s_%s.svg' % (noise, bottleneck,
                                                           exposures)
                model_results_sim = il_results.load(
                    '../data/model_sim/1.0_%s_%s_%s.json' %
                    (noise, bottleneck, exposures),
                    start_gen=0,
                    end_gen=50,
                    method='lang')
                model_results_inf = il_results.load(
                    '../data/model_inf/1.0_%s_%s_%s.json' %
                    (noise, bottleneck, exposures),
                    start_gen=0,
                    end_gen=50,
                    method='lang')
                model_results_inf_500 = il_results.load(
                    '../data/model_inf/500.0_%s_%s_%s.json' %
                    (noise, bottleneck, exposures),
                    start_gen=0,
                    end_gen=50,
                    method='lang')
                il_results.make_figure(
                    [(model_results_sim, 'Simplicity', colors.blue,
                      colors.light_blue, '-'),
                     (model_results_inf, 'Informativeness', colors.red,
                      colors.light_red, '-'),
                     (model_results_inf_500, 'Strong informativeness',
                      colors.red, colors.light_red, ':')],
                    figure_path=figure_path,
                    show_legend=True)
Example #2
0
def make_model_results_figure_carstensen(figure_path):
    model_results_sim_001 = il_results.load(
        '../data/model_sim/1.0_0.01_4_2.json',
        start_gen=0,
        end_gen=100,
        method='lang')
    model_results_sim_005 = il_results.load(
        '../data/model_sim/1.0_0.05_4_2.json',
        start_gen=0,
        end_gen=100,
        method='lang')
    model_results_sim_010 = il_results.load(
        '../data/model_sim/1.0_0.1_4_2.json',
        start_gen=0,
        end_gen=100,
        method='lang')
    il_results.make_carstensen_figure([
        (model_results_sim_001, 'ε = .01', colors.blue, colors.light_blue,
         '-'),
        (model_results_sim_005, 'ε = .05', colors.blue, colors.light_blue,
         '--'),
        (model_results_sim_010, 'ε = .1', colors.blue, colors.light_blue, ':')
    ],
                                      figure_path=figure_path,
                                      figsize=(3.46, 1.75))
Example #3
0
def make_model_comparison_figure(figure_path):
	experiment_results = il_results.load('../data/experiments/exp2_chains.json', start_gen=0, end_gen=10, method='prod')
	experiment_results_est = il_results.load('../data/experiments/exp2_chains.json', start_gen=10, end_gen=50, method='prod')
	model_results_sim = il_results.load('../data/model_sim/1.36_0.23_2_4.json', start_gen=0, end_gen=50, method='lang')
	model_results_inf = il_results.load('../data/model_inf/243.3_0.37_2_4.json', start_gen=0, end_gen=50, method='lang')
	il_results.make_figure([(experiment_results, 'Experimental results', colors.black, colors.light_black, '-'),
	             (experiment_results_est, '', colors.black, colors.light_black, ':'),
	             (model_results_sim, 'Simplicity prior (using best-fit parameters)', colors.blue, colors.light_blue, '-'),
	             (model_results_inf, 'Informativeness prior (using best-fit parameters)', colors.red, colors.light_red, '-')],
	             figure_path=figure_path, show_legend=True)
Example #4
0
def make_model_results_figure(figure_path):
    model_results_sim = il_results.load(
        '../data/test_modelfit/model/results.json',
        start_gen=0,
        end_gen=10,
        method='lang')
    dataset = (model_results_sim, 'Simplicity', colors.blue, colors.light_blue,
               '-')
    opt = load_optimizer('../data/test_modelfit/modelfit/result')
    make_figure(dataset, opt, figure_path=figure_path, n_levels=32)
Example #5
0
def supplementary_model_results(dir_path):
    il_results.figure_layout = [['expressivity', 'complexity'],
                                ['cost', 'error']]
    il_results.plt.rcParams.update({'font.size': 10})
    for e, noise in enumerate(['0.01', '0.05', '0.1'], 1):
        for b, bottleneck in enumerate(['1', '2', '3', '4'], 1):
            for x, exposures in enumerate(['1', '2', '3', '4'], 1):
                figure_path = dir_path + '%i%i%i.pdf' % (b, x, e)
                title = 'b = %s, ξ = %s, ε = %s' % (bottleneck, exposures,
                                                    noise)
                model_results_sim = il_results.load(
                    '../data/model_sim/1.0_%s_%s_%s.json' %
                    (noise, bottleneck, exposures),
                    start_gen=0,
                    end_gen=50,
                    method='lang')
                model_results_inf = il_results.load(
                    '../data/model_inf/1.0_%s_%s_%s.json' %
                    (noise, bottleneck, exposures),
                    start_gen=0,
                    end_gen=50,
                    method='lang')
                model_results_inf_500 = il_results.load(
                    '../data/model_inf/500.0_%s_%s_%s.json' %
                    (noise, bottleneck, exposures),
                    start_gen=0,
                    end_gen=50,
                    method='lang')
                il_results.make_figure(
                    [(model_results_sim, 'Simplicity prior (πsim, w = 1)',
                      colors.blue, colors.light_blue, '-'),
                     (model_results_inf, 'Informativeness prior (πinf, w = 1)',
                      colors.red, colors.light_red, '-'),
                     (model_results_inf_500,
                      'Strong informativeness prior (πinf, w = 500)',
                      colors.red, colors.light_red, ':')],
                    figure_path=figure_path,
                    title=title,
                    show_legend=True,
                    deep_legend=True)
Example #6
0
def make_model_results_figure(figure_path):
    model_results_sim = il_results.load('../data/model_sim/1.0_0.01_2_2.json',
                                        start_gen=0,
                                        end_gen=50,
                                        method='lang')
    model_results_inf = il_results.load('../data/model_inf/1.0_0.01_2_2.json',
                                        start_gen=0,
                                        end_gen=50,
                                        method='lang')
    model_results_inf_500 = il_results.load(
        '../data/model_inf/500.0_0.01_2_2.json',
        start_gen=0,
        end_gen=50,
        method='lang')
    il_results.make_figure(
        [(model_results_sim, 'Simplicity prior', colors.blue,
          colors.light_blue, '-'),
         (model_results_inf, 'Informativeness prior', colors.red,
          colors.light_red, '-'),
         (model_results_inf_500, 'Strong informativeness prior', colors.red,
          colors.light_red, ':')],
        figure_path=figure_path,
        show_legend=True)
Example #7
0
def thesis_appendix_model_results(dir_path):
    for b, bottleneck in enumerate(['1', '2', '3', '4'], 1):
        for x, exposures in enumerate(['1', '2', '3', '4'], 1):
            for e, noise in enumerate(['0.01', '0.05', '0.1'], 1):
                figure_path = dir_path + '%i%i%i.eps' % (b, x, e)
                title = 'b = %s, ξ = %s, ε = %s' % (bottleneck, exposures,
                                                    noise)
                model_results_sim = il_results.load(
                    '../data/model_sim/1.0_%s_%s_%s.json' %
                    (noise, bottleneck, exposures),
                    start_gen=0,
                    end_gen=50,
                    method='lang')
                model_results_inf = il_results.load(
                    '../data/model_inf/1.0_%s_%s_%s.json' %
                    (noise, bottleneck, exposures),
                    start_gen=0,
                    end_gen=50,
                    method='lang')
                model_results_inf_500 = il_results.load(
                    '../data/model_inf/500.0_%s_%s_%s.json' %
                    (noise, bottleneck, exposures),
                    start_gen=0,
                    end_gen=50,
                    method='lang')
                il_results.make_figure(
                    [(model_results_sim, 'Simplicity prior (πsim, w = 1)',
                      colors.blue, colors.light_blue, '-'),
                     (model_results_inf, 'Informativeness prior (πinf, w = 1)',
                      colors.red, colors.light_red, '-'),
                     (model_results_inf_500,
                      'Strong informativeness prior (πinf, w = 500)',
                      colors.red, colors.light_red, ':')],
                    figure_path=figure_path,
                    title=title,
                    show_legend=False,
                    figsize=(5.1, 2.8))
Example #8
0
def make_experiment_results_figure(figure_path):
	experiment_results = il_results.load('../data/experiments/exp2_chains.json', start_gen=0, end_gen=10, method='prod')
	il_results.make_figure([(experiment_results, 'Experiment', colors.black, colors.light_black, '-')],
		        figure_path=figure_path, show_legend=False)