Esempio n. 1
0
def main():
    args = exp_shared.parse_script_arguments()
    # Run experiment
    if args.pipeline == '':
        exp = run(args.host_name)
    else:
        # Load existing experiment
        exp = Experiment.load(args.pipeline)
        if args.resync == 'y':
            exp.wait(retry_interval=5)
            exp.queue.sync(exp.pipeline_path, exp.pipeline_path, sync_to=sge.SyncTo.LOCAL, recursive=True)


    cluster_ensemble = exp.get_flattened_results('agent_language_map')
    consensus = Correlation_Clustering.compute_consensus_map(cluster_ensemble, k=10, iter=100)
    print(consensus.values())

    # Visualize experiment
    visualize(exp)
Esempio n. 2
0
        i += 1

def visualize(exp):
    viz.plot_with_conf2(exp, 'regier_cost', 'term_usage', 'bw_boost')
    viz.plot_with_conf2(exp, 'wellformedness', 'term_usage', 'bw_boost')
    viz.plot_with_conf2(exp, 'term_usage', 'term_usage', 'bw_boost')

    e = com_enviroments.make('wcs')
    for t, maps in zip(exp.param_ranges['term_usage'], exp.reshape('language_map', as_function_of_axes=['term_usage'])):
        e.plot_with_colors(maps[0,:], save_to_path=exp.pipeline_path + 'ccc_map-' + str(t) + '_terms.png')

def main(args):
    # Run experiment
    exp = run(args.host_name, args.pipeline)

    # analyse results
    analyse(exp)

    exp.save()
    print("\nAll tasks queued to clusters")

    # wait for all tasks to complete
    exp.wait(retry_interval=5)
    exp.queue.sync(exp.pipeline_path, exp.pipeline_path, sync_to=sge.SyncTo.LOCAL, recursive=True)

    visualize(exp)

if __name__ == "__main__":
    main(exp_shared.parse_script_arguments().parse_args())