TF 2.0 is out! Get hands-on practice at TF World, Oct 28-31. Use code TF20 for 20% off select passes. Register now

Module: tfa.seq2seq.sampler

View source on GitHub

A library of sampler for use with SamplingDecoders.

Classes

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.

Functions

bernoulli_sample(...): Samples from Bernoulli distribution.

categorical_sample(...): Samples from categorical distribution.