sampler_sample_embedding {tfaddons} | R Documentation |
Sample Embedding Sampler
Description
A sampler for use during inference.
Usage
sampler_sample_embedding(
embedding_fn = NULL,
softmax_temperature = NULL,
seed = NULL
)
Arguments
embedding_fn |
(Optional) A callable that takes a vector tensor of ids (argmax ids), or the params argument for embedding_lookup. The returned tensor will be passed to the decoder input. |
softmax_temperature |
(Optional) float32 scalar, value to divide the logits by before computing the softmax. Larger values (above 1.0) result in more random samples, while smaller values push the sampling distribution towards the argmax. Must be strictly greater than 0. Defaults to 1.0. |
seed |
(Optional) The sampling seed. |
Details
Uses sampling (from a distribution) instead of argmax and passes the result through an embedding layer to get the next input.
Value
None
[Package tfaddons version 0.10.0 Index]