Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.

Commit 5ff25c9

Browse files
committed
Fixes #100: do not train keep probability in dropout op
1 parent 35e12d7 commit 5ff25c9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

skflow/ops/dropout_ops.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ def dropout(tensor_in, prob, name=None):
3838
with tf.op_scope([tensor_in], name, "dropout") as name:
3939
if isinstance(prob, float):
4040
prob = tf.get_variable("prob", [],
41-
initializer=tf.constant_initializer(prob))
41+
initializer=tf.constant_initializer(prob),
42+
trainable=False)
4243
tf.add_to_collection(DROPOUTS, prob)
4344
return tf.nn.dropout(tensor_in, prob)
4445

0 commit comments

Comments
 (0)