Only enable scheduled sampling for training
@@ -122,6 +122,8 @@ class SequenceToSequence(Model):
with tf.variable_scope("decoder") as decoder_scope:
if labels is not None:
+ sampling_probability = None
+ if mode == tf.estimator.ModeKeys.TRAIN:
sampling_probability = get_sampling_probability(
tf.train.get_or_create_global_step(),
read_probability=params.get("scheduled_sampling_read_probability"),
