Skip to content

Commit

Permalink
Do CNN dropout after pooling
Browse files Browse the repository at this point in the history
  • Loading branch information
feranick committed Oct 29, 2019
1 parent fabd84c commit 7983ebd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion SpectraKeras/SpectraKeras_CNN.py
Original file line number Diff line number Diff line change
Expand Up @@ -318,12 +318,12 @@ def train(learnFile, testFile, flag):
model.add(keras.layers.Conv2D(dP.CL_filter[i], (1, dP.CL_size[i]),
activation='relu',
input_shape=x_train[0].shape))
model.add(keras.layers.Dropout(dP.dropCNN[i]))
try:
model.add(keras.layers.MaxPooling2D(pool_size=(1, dP.max_pooling[i])))
except:
print(" WARNING: Pooling layer is larger than last convolution layer\n Aborting\n")
return
model.add(keras.layers.Dropout(dP.dropCNN[i]))
'''
try:
model.add(keras.layers.MaxPooling2D(pool_size=(1, dP.max_pooling)))
Expand Down

0 comments on commit 7983ebd

Please sign in to comment.