Last active
July 15, 2016 04:53
-
-
Save geffy/842b318ee31370119765345315100272 to your computer and use it in GitHub Desktop.
Main parts of our custom network for Data Science Game 2016 (online part)
This file contains 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 hard_normalizing(X): | |
return (X - 0.5) / 0.5 | |
def init_model(): | |
model = Sequential() | |
model.add(Convolution2D(64, 3, 3, border_mode='valid', input_shape=(3, 64, 64))) | |
model.add(Activation('relu')) | |
model.add(MaxPooling2D(pool_size=(2, 2))) | |
model.add(Convolution2D(32, 3, 3, border_mode='valid')) | |
model.add(Activation('relu')) | |
model.add(Convolution2D(32, 3, 3, border_mode='valid')) | |
model.add(Activation('relu')) | |
model.add(MaxPooling2D(pool_size=(2, 2))) | |
model.add(Convolution2D(32, 3, 3, border_mode='valid')) | |
model.add(Activation('relu')) | |
model.add(Convolution2D(16, 3, 3, border_mode='valid')) | |
model.add(Activation('relu')) | |
model.add(MaxPooling2D(pool_size=(2, 2))) | |
model.add(Flatten()) | |
model.add(Dropout(0.3)) | |
model.add(Dense(32)) | |
model.add(Activation('relu')) | |
model.add(Dropout(0.3)) | |
model.add(Dense(4)) | |
model.add(Activation('softmax')) | |
sgd = Adam(lr=0.001) | |
model.compile(loss='categorical_crossentropy', optimizer=sgd) | |
return model |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment