Exemplo n.º 1
0
insideCores = 3  # each convolution setup has this number of cores in the first layer and twice that in the second

num_classes = 10
channel_style = 'channels_last'
my_shape = [28, 28, 1]
if data_set_type == 'cifar':
    (x_train, y_train), (x_test, y_test) = h.getHcifar10()
    channel_style = 'channels_first'
    my_shape = [3, 32, 32]
elif data_set_type == 'cifar100':
    (x_train, y_train), (x_test, y_test) = h.getHcifar100()
    channel_style = 'channels_first'
    my_shape = [3, 32, 32]
    num_classes = 100
elif data_set_type == 'fashion_mnist':
    (x_train, y_train), (x_test, y_test) = h.getHFmnistConv()
elif data_set_type == 'fashion_mnist_noise':
    (x_train, y_train), (x_test,
                         y_test) = h.getHFmnistConvNoise(noiseImagesNumber)
elif data_set_type == 'mnist_noise':
    (x_train, y_train), (x_test,
                         y_test) = h.getHmnistConvNoise(noiseImagesNumber)
else:
    (x_train, y_train), (x_test, y_test) = h.getHmnistConv()

y_train = keras.utils.to_categorical(y_train, num_classes)
y_test = keras.utils.to_categorical(y_test, num_classes)


def doubleConvMP(num_cores, asize, my_layers, my_input):
    localSize = (asize[0], asize[1])
Exemplo n.º 2
0
myLr = 0.001

channel_style = 'channels_last'
my_shape = [28, 28, 1]
if data_set_type == 'cifar':
    (x_train, y_train_i), (x_test, y_test_i) = h.getHcifar10()
    channel_style = 'channels_first'
    my_shape = [3, 32, 32]
elif data_set_type == 'cifar100':
    (x_train, y_train_i), (x_test, y_test_i) = h.getHcifar100()
    channel_style = 'channels_first'
    my_shape = [3, 32, 32]
    testRange = 100
elif data_set_type == 'fashion_mnist':
    (x_train, y_train_i), (x_test, y_test_i) = h.getHFmnistConv()
elif data_set_type == 'fashion_mnist_noise':
    (x_train, y_train_i), (x_test,
                           y_test_i) = h.getHFmnistConvNoise(noiseImagesNumber)
elif data_set_type == 'mnist_noise':
    (x_train, y_train_i), (x_test,
                           y_test_i) = h.getHmnistConvNoise(noiseImagesNumber)
else:
    (x_train, y_train_i), (x_test, y_test_i) = h.getHmnistConv()

h.printTime()

my_scores = []
my_rects = []
input1 = Input(shape=my_shape)