Skip to content

Commit

Permalink
reduce dropout in crnn, remove dropout in cnn
Browse files Browse the repository at this point in the history
  • Loading branch information
keunwoochoi committed Oct 27, 2016
1 parent efac88d commit 0102bea
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
5 changes: 0 additions & 5 deletions music_tagger_cnn.py
Expand Up @@ -94,35 +94,30 @@ def MusicTaggerCNN(weights='msd', input_tensor=None,
x = BatchNormalization(axis=channel_axis, mode=0, name='bn1')(x)
x = ELU()(x)
x = MaxPooling2D(pool_size=(2, 4), name='pool1')(x)
x = Dropout(0.5, name='dropout1')(x)

# Conv block 2
x = Convolution2D(128, 3, 3, border_mode='same', name='conv2')(x)
x = BatchNormalization(axis=channel_axis, mode=0, name='bn2')(x)
x = ELU()(x)
x = MaxPooling2D(pool_size=(2, 4), name='pool2')(x)
x = Dropout(0.5, name='dropout2')(x)

# Conv block 3
x = Convolution2D(128, 3, 3, border_mode='same', name='conv3')(x)
x = BatchNormalization(axis=channel_axis, mode=0, name='bn3')(x)
x = ELU()(x)
x = MaxPooling2D(pool_size=(2, 4), name='pool3')(x)
x = Dropout(0.5, name='dropout3')(x)

# Conv block 4
x = Convolution2D(192, 3, 3, border_mode='same', name='conv4')(x)
x = BatchNormalization(axis=channel_axis, mode=0, name='bn4')(x)
x = ELU()(x)
x = MaxPooling2D(pool_size=(3, 5), name='pool4')(x)
x = Dropout(0.5, name='dropout4')(x)

# Conv block 5
x = Convolution2D(256, 3, 3, border_mode='same', name='conv5')(x)
x = BatchNormalization(axis=channel_axis, mode=0, name='bn5')(x)
x = ELU()(x)
x = MaxPooling2D(pool_size=(4, 4), name='pool5')(x)
x = Dropout(0.5, name='dropout5')(x)

# Output
x = Flatten()(x)
Expand Down
8 changes: 4 additions & 4 deletions music_tagger_crnn.py
Expand Up @@ -91,28 +91,28 @@ def MusicTaggerCRNN(weights='msd', input_tensor=None,
x = BatchNormalization(axis=channel_axis, mode=0, name='bn1')(x)
x = ELU()(x)
x = MaxPooling2D(pool_size=(2, 2), strides=(2, 2), name='pool1')(x)
x = Dropout(0.5, name='dropout1')(x)
x = Dropout(0.1, name='dropout1')(x)

# Conv block 2
x = Convolution2D(128, 3, 3, border_mode='same', name='conv2')(x)
x = BatchNormalization(axis=channel_axis, mode=0, name='bn2')(x)
x = ELU()(x)
x = MaxPooling2D(pool_size=(3, 3), strides=(3, 3), name='pool2')(x)
x = Dropout(0.5, name='dropout2')(x)
x = Dropout(0.1, name='dropout2')(x)

# Conv block 3
x = Convolution2D(128, 3, 3, border_mode='same', name='conv3')(x)
x = BatchNormalization(axis=channel_axis, mode=0, name='bn3')(x)
x = ELU()(x)
x = MaxPooling2D(pool_size=(4, 4), strides=(4, 4), name='pool3')(x)
x = Dropout(0.5, name='dropout3')(x)
x = Dropout(0.1, name='dropout3')(x)

# Conv block 4
x = Convolution2D(128, 3, 3, border_mode='same', name='conv4')(x)
x = BatchNormalization(axis=channel_axis, mode=0, name='bn4')(x)
x = ELU()(x)
x = MaxPooling2D(pool_size=(4, 4), strides=(4, 4), name='pool4')(x)
x = Dropout(0.5, name='dropout4')(x)
x = Dropout(0.1, name='dropout4')(x)

# reshaping
if K.image_dim_ordering() == 'th':
Expand Down

0 comments on commit 0102bea

Please sign in to comment.