Example #1
0
def basic(iterations, profile):
    options = Options()
    options.serial = True
    #options.accperclass = True
    options.convlayers = 0
    options.step = 20
    options.combine = True
    options.post_init()
    x_train, y_train, x_test, y_test = get_dataset(options)  # pylint: disable=unused-variable
    model = train_network(get_model(x_test, options), options)
    only_convolutional, _ = split_network(model, options.convlayers)  # pylint: disable=unused-variable
    cmd_string = """run_experiment(iterations, options, x_train, y_train, x_test, y_test,
                    model, only_convolutional, EXPERIMENT_DIR + '/basic.csv')"""
    if profile:
        cProfile.run(cmd_string, PROFILING_DIR + '/basic')
    else:
        exec(cmd_string)
Example #2
0
def rot_first(iterations, profile):
    options = Options()
    options.serial = True
    options.convlayers = 5
    options.step = 20
    options.combine = False
    options.representatives = False
    options.rotate_first = True
    options.post_init()
    x_train, y_train, x_test, y_test = get_dataset(options)  # pylint: disable=unused-variable
    model = train_network(get_model(x_test, options), options)
    options.convlayers = get_last_conv_layer(model) + 1
    only_convolutional, _ = split_network(model, options.convlayers)  # pylint: disable=unused-variable
    cmd_string = """run_experiment(iterations, options, x_train, y_train, x_test, y_test,
                    model, only_convolutional, EXPERIMENT_DIR + '/rotate_first.csv')"""
    if profile:
        cProfile.run(cmd_string, PROFILING_DIR + '/rotate_first')
    else:
        exec(cmd_string)