test stop grad.
@@ -219,9 +219,9 @@ class ConvS2SEncoder2(Encoder):
# Gradients are scaled as the gradients from
# all decoder attention layers enters the encoder
#changed
- # scale = 1.0 / (
- # 2.0 * self.params.get("att_layer_num", 1))
- # outputs = (1.0 - scale) * tf.stop_gradient(outputs) + scale * outputs
+ scale = 1.0 / (
+ 2.0 * self.params.get("att_layer_num", 1))
+ outputs = (1.0 - scale) * tf.stop_gradient(outputs) + scale * outputs
outputs_b = (outputs + encoder_inputs) * self.scaling_factor
