예제 #1
0
def ensemble_agum(in_path, out_path, n_epochs=1000, size=128):
    model = ts_cnn.TS_CNN(dropout=0.5, optim_alg=deep.Nestrov())
    train, extract = ts_cnn.get_train(model)
    ensemble = ens.ts_ensemble(train, extract, preproc=norm_partial)
    input_paths = files.top_files(in_path)
    arg_dict = {"n_epochs": n_epochs, "size": size}
    files.make_dir(out_path)
    ensemble(input_paths, out_path, arg_dict)
예제 #2
0
def ensemble_exp(in_path, out_name, n_epochs=1000, size=64):
    input_paths = files.top_files("%s/seqs" % in_path)
    out_path = "%s/%s" % (in_path, out_name)
    ts_cnn = TS_CNN(dropout=0.5, activ='elu', optim_alg=deep.Nestrov())
    train, extract = get_train(ts_cnn)
    ensemble = ens.ts_ensemble(train, extract)
    arg_dict = {'size': size, 'n_epochs': n_epochs}
    ensemble(input_paths, out_path, arg_dict)
예제 #3
0
def ensemble_agum(in_path, out_path, n_epochs=1000, size=128):
    model = ts_cnn.TS_CNN(dropout=0.5, l1=None, optim_alg=deep.Nestrov())
    train, extract = ts_cnn.get_train(model)
    agum = Agum([ts_binary])
    funcs = [[spline.upsample, ["seqs", "spline", "size"]],
             [agum, ["spline", "agum"]], [train, ["agum", "nn", "n_epochs"]],
             [extract, ["agum", "nn", "feats"]]]
    dir_names = ["spline", "agum", "nn", "feats"]
    ensemble = ens.EnsTransform(funcs, dir_names)
    arg_dict = {"n_epochs": n_epochs, "size": size}
    input_paths = files.top_files(in_path)
    files.make_dir(out_path)
    ensemble(input_paths, out_path, arg_dict)
예제 #4
0
def multi_exp(in_path, out_name, n_epochs=1000, size=64):
    out_path = "%s/%s" % (in_path, out_name)
    train_dict = {
        "no_l1": TS_CNN(l1=None),
        "dropout_0.5": TS_CNN(dropout=0.5),
        "adam": TS_CNN(optim_alg=deep.Adam()),
        "nestrov": TS_CNN(optim_alg=deep.Nestrov()),
        "tanh": TS_CNN(activ='tanh'),
        "base": TS_CNN()
    }
    train_dict = {
        name_i: get_train(train_i)
        for name_i, train_i in train_dict.items()
    }
    arg_dict = {'size': size, 'n_epochs': n_epochs}
    ens.multimodel_ensemble(in_path, out_path, train_dict, arg_dict)
예제 #5
0
def simple_exp(in_path, out_path, n_epochs=1000):
    ts_cnn = TS_CNN(dropout=0.5, activ='elu', optim_alg=deep.Nestrov())
    train, extract = get_train(ts_cnn)
    utils.single_exp_template(in_path, out_path, train, extract)