BeamSearch sampling decoder
decoder_beam_search(
object,
cell,
beam_width,
embedding_fn = NULL,
output_layer = NULL,
length_penalty_weight = 0,
coverage_penalty_weight = 0,
reorder_tensor_arrays = TRUE,
...
)
Model or layer object
An RNNCell instance.
integer, the number of beams.
A callable that takes a vector tensor of ids (argmax ids).
(Optional) An instance of tf.keras.layers.Layer, i.e., tf$keras$layers$Dense. Optional layer to apply to the RNN output prior to storing the result or sampling.
Float weight to penalize length. Disabled with 0.0.
Float weight to penalize the coverage of source sentence. Disabled with 0.0.
If `TRUE`, TensorArrays' 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 TensorArrays that are not amenable to reordering.
A list, other keyword arguments for initialization.
None