Skip to content

Commit 3b83374

Browse files
committed
models: Fix Dropout location
Suprised this was able to train at all before, as whole classes must have been dropped Training and validation loss now follow eachother much more closely
1 parent 7473435 commit 3b83374

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

microesc/models/sbcnn.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,12 @@ def build_model(frames=128, bands=128, channels=1, num_labels=10,
5656
backend = [
5757
Flatten(),
5858

59+
Dropout(dropout),
5960
Dense(fully_connected, kernel_regularizer=l2(0.001)),
6061
Activation('relu'),
61-
Dropout(dropout),
6262

63-
Dense(num_labels, kernel_regularizer=l2(0.001)),
6463
Dropout(dropout),
64+
Dense(num_labels, kernel_regularizer=l2(0.001)),
6565
Activation('softmax'),
6666
]
6767
layers = block1 + block2 + block3 + backend

microesc/models/strided.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,12 +98,12 @@ def backend_dense1(x, n_classes, fc=64, regularization=0.001, dropout=0.5):
9898
"""
9999

100100
x = Flatten()(x)
101+
x = Dropout(dropout)(x)
101102
x = Dense(fc, kernel_regularizer=l2(regularization))(x)
102103
x = Activation('relu')(x)
103-
x = Dropout(dropout)(x)
104104

105-
x = Dense(n_classes, kernel_regularizer=l2(regularization))(x)
106105
x = Dropout(dropout)(x)
106+
x = Dense(n_classes, kernel_regularizer=l2(regularization))(x)
107107
x = Activation('softmax')(x)
108108
return x
109109

0 commit comments

Comments
 (0)