tf.random_poisson

tf.random_poisson

tf.random_poisson

random_poisson(
    lam,
    shape,
    dtype=tf.float32,
    seed=None,
    name=None
)

Defined in tensorflow/python/ops/random_ops.py.

Draws shape samples from each of the given Poisson distribution(s).

lam is the rate parameter describing the distribution(s).

Example:

samples = tf.random_poisson([0.5, 1.5], [10]) # samples has shape [10, 2], where each slice [:, 0] and [:, 1] represents # the samples drawn from each distribution

samples = tf.random_poisson([12.2, 3.3], [7, 5]) # samples has shape [7, 5, 2], where each slice [:, :, 0] and [:, :, 1] # represents the 7x5 samples drawn from each of the two distributions

Args:

  • lam: A Tensor or Python value or N-D array of type dtype. lam provides the rate parameter(s) describing the poisson distribution(s) to sample.
  • shape: A 1-D integer Tensor or Python array. The shape of the output samples to be drawn per "rate"-parameterized distribution.
  • dtype: The type of lam and the output: float16, float32, or float64.
  • seed: A Python integer. Used to create a random seed for the distributions. See tf.set_random_seed for behavior.
  • name: Optional name for the operation.

Returns:

  • samples: a Tensor of shape tf.concat(shape, tf.shape(lam)) with values of type dtype.

© 2017 The TensorFlow Authors. All rights reserved.
Licensed under the Creative Commons Attribution License 3.0.
Code samples licensed under the Apache 2.0 License.
https://www.tensorflow.org/api_docs/python/tf/random_poisson

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部