Link Search Menu Expand Document

RandomGamma


tensorflow C++ API

tensorflow::ops::RandomGamma

Outputs random values from the Gamma distribution(s) described by alpha.


Summary

This op uses the algorithm by Marsaglia et al. to acquire samples via transformation-rejection from pairs of uniform and normal random variables. See http://dl.acm.org/citation.cfm?id=358414

Arguments:

  • scope: A Scope object
  • shape: 1-D integer tensor. Shape of independent samples to draw from each distribution described by the shape parameters given in alpha.
  • alpha: A tensor in which each scalar is a “shape” parameter describing the associated gamma distribution.

Optional attributes (see Attrs):

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

Returns:

  • Output: A tensor with shape shape + shape(alpha). Each slice [:, ..., :, i0, i1, ...iN] contains the samples drawn for alpha[i0, i1, ...iN]. The dtype of the output matches the dtype of alpha.

RandomGamma 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 shape: connect Input node.
  • Input alpha: connect Input node.
  • RandomGamma ::Attrs attrs : Input attrs in value. ex) seed_ = 0;seed2_ = 0;

Return:

  • Output output : Output object of RandomGamma class object.

Result:

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

Using Method