|View source on GitHub|
A library of sampler for use with SamplingDecoders.
class CustomSampler: Base abstract class that allows the user to customize sampling.
class GreedyEmbeddingSampler: A sampler for use during inference.
class InferenceSampler: A helper to use during inference with a custom sampling function.
class SampleEmbeddingSampler: A sampler for use during inference.
class Sampler: Interface for implementing sampling in seq2seq decoders.
class ScheduledEmbeddingTrainingSampler: A training sampler that adds scheduled sampling.
class ScheduledOutputTrainingSampler: A training sampler that adds scheduled sampling directly to outputs.
class TrainingSampler: A Sampler for use during training.
Initializer(...): Union type; Union[X, Y] means either X or Y.
TensorLike(...): Union type; Union[X, Y] means either X or Y.
bernoulli_sample(...): Samples from Bernoulli distribution.
categorical_sample(...): Samples from categorical distribution.