According to A Guide to TF Layers the dropout layer goes after the last dense layer:
dense = tf.layers.dense(input, units=1024, activation=tf.nn.relu)
dropout = tf.layers.dropout(dense, rate=params['dropout_rate'],
training=mode == tf.estimator.ModeKeys.TRAIN)
logits = tf.layers.dense(dropout, units=params['output_classes'])
Doesn't it make more sense to have it before that dense layer, so it learns the mapping from input to output with the dropout effect?
dropout = tf.layers.dropout(prev_layer, rate=params['dropout_rate'],
training=mode ==
dense = tf.layers.dense(dropout, units=1024, activation=tf.nn.relu)
logits = tf.layers.dense(dense, units=params['output_classes'])