def train_and_plot_SFO_variations(num_passes=51, base_fname='convergence_variations'):
    """
    Same as train_and_plot(), but compares different variations of SFO to each
    other, rather than SFO to other optimizers.
    """
    base_fname += "_%s_"%(datetime.datetime.now().strftime("%Y%m%d-%H%M%S"))
    generate_data_SFO_variations(num_passes=num_passes, base_fname=base_fname)
    history_nested, num_subfunctions, full_objective_period = convergence_utils.load_results(base_fname=base_fname)
    convergence_utils.make_plots(history_nested, num_subfunctions, full_objective_period, name_prefix='variations_')
def train_and_plot(num_passes=51, base_fname='convergence'):
    """
    Train all the models.  Save the function value and parameter settings from
    convergence.  Reload the resutls, plot them, and save the plots.

    Note that plots can be generated from previously saved histories, using load_results.
    To change the models to train and the optimizers to use
    """
    base_fname += "_%s_"%(datetime.datetime.now().strftime("%Y%m%d-%H%M%S"))
    generate_data(num_passes=num_passes, base_fname=base_fname)
    history_nested, num_subfunctions, full_objective_period = convergence_utils.load_results(base_fname=base_fname)
    convergence_utils.make_plots(history_nested, num_subfunctions, full_objective_period)