(self, input_sequence, output_sequence, sequence_length,
            control_sequence=None)
return optimizer
Train on the given sequences, returning an optimizer.

    Args:
      input_sequence: The sequence to be fed to the encoder.
      output_sequence: The sequence expected from the decoder.
      sequence_length: The length of the given sequences (which must be
          identical).
      control_sequence: (Optional) sequence on which to condition. This will be
          concatenated depthwise to the model inputs for both encoding and
          decoding.

    Returns:
      optimizer: A tf.train.Optimizer.
Train on the given sequences, returning an optimizer.
Train on the given sequences returning an optimizer .
def train(self, input_sequence, output_sequence, sequence_length,
            control_sequence=None):
    """Train on the given sequences, returning an optimizer.

    Args:
      input_sequence: The sequence to be fed to the encoder.
      output_sequence: The sequence expected from the decoder.
      sequence_length: The length of the given sequences (which must be
          identical).
      control_sequence: (Optional) sequence on which to condition. This will be
          concatenated depthwise to the model inputs for both encoding and
          decoding.

    Returns:
      optimizer: A tf.train.Optimizer.
    """

    _, scalars_to_summarize = self._compute_model_loss(
        input_sequence, output_sequence, sequence_length, control_sequence)

    hparams = self.hparams
    lr = ((hparams.learning_rate - hparams.min_learning_rate) *
          tf.pow(hparams.decay_rate, tf.to_float(self.global_step)) +
          hparams.min_learning_rate)

    optimizer = tf.train.AdamOptimizer(lr)

    tf.summary.scalar('learning_rate', lr)
    for n, t in scalars_to_summarize.items():
      tf.summary.scalar(n, tf.reduce_mean(t))

    return optimizer
def train ( self , input_sequence , output_sequence , sequence_length , control_sequence = None ) : _ , scalars_to_summarize = self . _compute_model_loss ( input_sequence , output_sequence , sequence_length , control_sequence ) hparams = self . hparams lr = ( ( hparams . learning_rate - hparams . min_learning_rate ) * tf . pow ( hparams . decay_rate , tf . to_float ( self . global_step ) ) + hparams . min_learning_rate ) optimizer = tf . train . AdamOptimizer ( lr ) tf . summary . scalar ( 'learning_rate' , lr ) for n , t in scalars_to_summarize . items ( ) : tf . summary . scalar ( n , tf . reduce_mean ( t ) ) return optimizer