sampler_sample_embedding: Sample Embedding Sampler

Description Usage Arguments Details Value

Description

A sampler for use during inference.

Usage

1
2
3
4
5
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


tfaddons documentation built on July 2, 2020, 2:12 a.m.