@@ -39,7 +39,8 @@ def _apply_dense(self, grad, var):
39
39
def conv_layers (sequences , filters = FLAGS .conv_filters ,
40
40
kernel_sizes = ((11 , 41 ), (11 , 21 ), (11 , 21 )),
41
41
strides = ((2 , 2 ), (1 , 2 ), (1 , 2 )),
42
- kernel_initializer = tf .glorot_normal_initializer (), kernel_regularizer = None ):
42
+ kernel_initializer = tf .glorot_normal_initializer (), kernel_regularizer = None ,
43
+ training = True ):
43
44
"""Add 2D convolutional layers to the network's graph. New sequence length are being calculated.
44
45
45
46
Convolutional layer output shapes:
@@ -72,6 +73,8 @@ def conv_layers(sequences, filters=FLAGS.conv_filters,
72
73
TensorFlow kernel initializer.
73
74
kernel_regularizer (tf.Tensor):
74
75
TensorFlow kernel regularizer.
76
+ training (bool):
77
+ `FLAGS.conv_dropout_rate` is being applied during training only.
75
78
76
79
Returns:
77
80
tf.Tensor: `output`
@@ -102,7 +105,7 @@ def conv_layers(sequences, filters=FLAGS.conv_filters,
102
105
kernel_regularizer = kernel_regularizer )
103
106
104
107
output = tf .minimum (output , FLAGS .relu_cutoff )
105
- # output = tf.layers.dropout(output, rate=FLAGS.dense_dropout_rate , training=training)
108
+ output = tf .layers .dropout (output , rate = FLAGS .conv_dropout_rate , training = training )
106
109
107
110
# Reshape to: conv3 = [batch_size, time, 10 * NUM_FILTERS], where 10 is the number of
108
111
# frequencies left over from convolutions.
0 commit comments