Link Search Menu Expand Document

Multinomial


tensorflow C++ API

tensorflow::ops::Multinomial

Draws samples from a multinomial distribution.


Summary

Arguments:

  • scope: A Scope object

  • logits: 2-D Tensor with shape[batch_size, num_classes]. Each slice[i, :]
    represents the unnormalized log probabilities for all classes.

  • num_samples: 0-D. Number of independent samples to draw for each row slice.

Optional attributes (seeAttrs):

  • seed: If either seed or seed2 is set to be non-zero, the internal random number generator is seeded by the given seed. Otherwise, a random seed is used.
  • seed2: A second seed to avoid seed collision.

Returns:

  • Output: 2-D Tensor with shape[batch_size, num_samples]. Each slice [i, :] contains the drawn class labels with range[0, num_classes) .

Multinomial block

Source link : https://github.com/EXPNUNI/enuSpaceTensorflow/blob/master/enuSpaceTensorflow/tf_random.cpp

Argument:

  • Scope scope : A Scope object (A scope is generated automatically each page. A scope is not connected.)
  • Input logits : connect Input node.
  • Input num_samples : connect Input node.
  • Multinomial ::Attrs attrs : Input attrs in value. ex) seed_ = 0;seed2_ = 0;

Return:

  • Output output : Output object of Multinomial class object.

Result:

  • std::vector(Tensor) product_result : Returned object of executed result by calling session.

Using Method