org.platanios.tensorflow.api.ops.seq2seq.decoders
RNN cell to use for decoding.
Initial RNN cell state to use for starting the decoding process.
Function that takes an INT32
vector of IDs and returns the corresponding embedded
values that will be passed to the decoder input.
INT32
vector with length equal to the batch size, which contains the begin-of-sequence
token IDs.
INT32
scalar containing the end-of-sequence token ID (i.e., token ID which marks the
end of decoding).
Beam width to use for the beam search while decoding.
Length penalty method.
Output layer to use that is applied at the outputs of the provided RNN cell before returning them.
If true
, TensorArray
s' elements within the cell state will be reordered according to
the beam search path. If the TensorArray
can be reordered, the stacked form will be
returned. Otherwise, the TensorArray
will be returned as is. Set this flag to false
if the cell state contains any TensorArray
s that are not amenable to reordering.
Name prefix used for all created ops.
Scalar INT32
tensor representing the batch size of the input values.
Scalar INT32
tensor representing the batch size of the input values.
Beam width to use for the beam search while decoding.
INT32
vector with length equal to the batch size, which contains the begin-of-sequence
token IDs.
RNN cell to use for decoding.
RNN cell to use for decoding.
Performs dynamic decoding using this decoder.
Performs dynamic decoding using this decoder.
This method calls initialize()
once and next()
repeatedly.
Function that takes an INT32
vector of IDs and returns the corresponding embedded
values that will be passed to the decoder input.
INT32
scalar containing the end-of-sequence token ID (i.e., token ID which marks the
end of decoding).
Finalizes the output of the decoding process.
Finalizes the output of the decoding process.
Final output after decoding.
Final state after decoding.
Tensor containing the sequence lengths that the decoder cell outputs.
Finalized output and state to return from the decoding process.
Initial RNN cell state to use for starting the decoding process.
This method is called before any decoding iterations.
This method is called before any decoding iterations. It computes the initial input values and the initial state.
Tuple containing: (i) a scalar BOOLEAN
tensor specifying whether initialization has finished,
(ii) the next input, and (iii) the initial decoder state.
Length penalty method.
Name prefix used for all created ops.
Name prefix used for all created ops.
This method is called once per step of decoding (but only once for dynamic decoding).
This method is called once per step of decoding (but only once for dynamic decoding).
Tuple containing: (i) the decoder output for this step, (ii) the next decoder state, (iii) the next input,
and (iv) a scalar BOOLEAN
tensor specifying whether decoding has finished.
Output layer to use that is applied at the outputs of the provided RNN cell before returning them.
If true
, TensorArray
s' elements within the cell state will be reordered according to
the beam search path.
If true
, TensorArray
s' elements within the cell state will be reordered according to
the beam search path. If the TensorArray
can be reordered, the stacked form will be
returned. Otherwise, the TensorArray
will be returned as is. Set this flag to false
if the cell state contains any TensorArray
s that are not amenable to reordering.
Describes whether the decoder keeps track of finished states.
Describes whether the decoder keeps track of finished states.
Most decoders will emit a true/false finished
value independently at each time step. In this case, the
dynamicDecode()
function keeps track of which batch entries have already finished, and performs a logical OR to
insert new batches to the finished set.
Some decoders, however, shuffle batches/beams between time steps and dynamicDecode()
will mix up the finished
state across these entries because it does not track the reshuffling across time steps. In this case, it is up to
the decoder to declare that it will keep track of its own finished state by setting this property to true
.
The beam-search decoder shuffles its beams and their finished state. For this reason, it conflicts with the
dynamicDecode
function's tracking of finished states. Setting this property to true
avoids early stopping of
decoding due to mismanagement of the finished state in dynamicDecode
.
Recurrent Neural Network (RNN) that uses beam search to find the highest scoring sequence (i.e., perform decoding).