W3cubDocs

/TensorFlow Python

tf.contrib.seq2seq.simple_decoder_fn_train(encoder_state, name=None)

tf.contrib.seq2seq.simple_decoder_fn_train(encoder_state, name=None)

Simple decoder function for a sequence-to-sequence model used in the dynamic_rnn_decoder.

The simple_decoder_fn_train is a simple training function for a sequence-to-sequence model. It should be used when dynamic_rnn_decoder is in the training mode.

The simple_decoder_fn_train is called with a set of the user arguments and returns the decoder_fn, which can be passed to the dynamic_rnn_decoder, such that

dynamic_fn_train = simple_decoder_fn_train(encoder_state)
outputs_train, state_train = dynamic_rnn_decoder(
    decoder_fn=dynamic_fn_train, ...)

Further usage can be found in the kernel_tests/seq2seq_test.py.

Args:

  • encoder_state: The encoded state to initialize the dynamic_rnn_decoder.
  • name: (default: None) NameScope for the decoder function; defaults to "simple_decoder_fn_train"

Returns:

A decoder function with the required interface of dynamic_rnn_decoder intended for training.

Defined in tensorflow/contrib/seq2seq/python/ops/decoder_fn.py.

© 2017 The TensorFlow Authors. All rights reserved.
Licensed under the Creative Commons Attribution License 3.0.
Code samples licensed under the Apache 2.0 License.
https://www.tensorflow.org/api_docs/python/tf/contrib/seq2seq/simple_decoder_fn_train