Created
February 9, 2017 18:36
-
-
Save keunwoochoi/9cfceee63b4a272d5ea0293978b90a3e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def cnn_model(n_ch): | |
'''Assuming cifar-10 ''' | |
input_shape = (3, 32, 32) | |
model = Sequential() | |
for i in range(N_LAYER): | |
if i == 0: | |
model.add(Convolution2D(n_ch, 3, 3, border_mode='same', | |
input_shape=input_shape, | |
name='conv%d' % i)) | |
else: | |
model.add(Convolution2D(n_ch, 3, 3, border_mode='same', | |
name='conv%d' % i)) | |
model.add(Activation('elu')) | |
model.add(MaxPooling2D(pool_size=(2, 2))) | |
model.add(Flatten()) | |
model.add(Dense(N_CLASS)) | |
model.add(Activation('softmax')) | |
return model |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment