tf.compat.v1.multinomial

View source on GitHub

Draws samples from a multinomial distribution. (deprecated)

tf.compat.v1.multinomial(
    logits, num_samples, seed=None, name=None, output_dtype=None
)

Warning: THIS FUNCTION IS DEPRECATED. It will be removed in a future version. Instructions for updating: Use tf.random.categorical instead.

Example:

# samples has shape [1, 5], where each value is either 0 or 1 with equal
# probability.
samples = tf.random.categorical(tf.math.log([[0.5, 0.5]]), 5)

Args:

Returns:

The drawn samples of shape [batch_size, num_samples].