Пример #1
0
    fig = rpt.make_plot(pd)
    fig = rpt.make_plot(pd_h, h_figure=fig, axes_index=0)
    return fig


# * New model, suspecting something is off.
models = ['2020-02-13-22.48.36', '2020-01-30-14.12.49']

# * Stacked LSTM 256 HUBER LOSS, L2 1024 LSTM, LSTM 512 HUBER LOSS
#models = ['2020-01-19-22.00.11', '2020-01-17-02.06.38', '2020-01-30-11.17.16']#, '2020-01-17-13.35.31']
# models = ['2020-01-08-13.54.40', ]

perf_classes = []
for model in models:

    # * Locate the model directory
    paths = hf.find_files(model)
    for path in paths:
        if path.split('/')[-1] == model:
            break

    perf_class_path = path + '/data/EnergyPerformance.pickle'
    perf_class = pickle.load(open(perf_class_path, "rb"))
    perf_classes.append(perf_class)

path = get_project_root() + '/plots/polar_L2_vs_sqr_angle.png'
title = 'Energy: Stacked 256 LSTM-size Huber (blue), 1028 LSTM L2 (orange)'

fig = energy_plot(models, perf_classes, title=title)  #, savefig=path)
Пример #2
0
                    type=float,
                    help='Sets the minimum learning rate for scan inspection.')
parser.add_argument('--min_yrange',
                    default=np.inf,
                    type=float,
                    help='Sets the minimum learning rate for scan inspection.')
args = parser.parse_args()

if __name__ == '__main__':
    if args.path != None:
        model_dir = args.path
    if 'model_dir' not in locals():
        raise ValueError('No path supplied!')

    # * Locate the model directory
    paths = find_files(model_dir)
    for path in paths:
        if path.split('/')[-1] == model_dir:
            model = path
            break

    from_lr, to_lr = args.min_lr, args.max_lr
    lrs = pickle.load(open(model + '/lr.pickle', 'rb'))
    losses = pickle.load(open(model + '/loss_vals.pickle', 'rb'))
    indices = [
        index for index in range(len(lrs)) if from_lr <= lrs[index] <= to_lr
    ]

    chosen_lrs = np.array(lrs)[indices]
    chosen_losses = np.array(losses)[indices]
    if args.max_yrange != np.inf:
Пример #3
0
from src.modules.main_funcs import (calc_predictions_pickle, 
load_model_pars, get_project_root)

description = 'Runs all experiments saved in "/experiments" starting with the oldest.'
parser = argparse.ArgumentParser(description=description)
parser.add_argument('-p', '--path', nargs='+', metavar='', type=str, help='Paths to model directories')


args = parser.parse_args()

if __name__ == '__main__':

    for model in args.path:
        
        # * Locate the model directory
        paths = find_files(model)
        for path in paths:
            if path.split('/')[-1] == model:
                break
        hyper_pars, data_pars, arch_pars, meta_pars = load_model_pars(path)
        WANDB_DIR = get_project_root()+'/models'
        PROJECT = meta_pars['project']
        WANDB_ID = path.split('/')[-1]
        wandb.init(resume=True, id=WANDB_ID, dir=WANDB_DIR, project=PROJECT)

        # * Load the model and check all predictions are there
        perf_class_path = path +'/data/Performance.pickle'
        perf_class = pickle.load( open( perf_class_path, "rb" ) )
        perf_class.update_onenumber_performance()
        perf = perf_class.onenumber_performance
        print(get_time(), 'Onenumber performance: %.3f'%(perf))