tf.compat.v1.random_poisson
Выборка shape образцов из каждого заданного распределения Пуассона.
tf.compat.v1.random_poisson(
lam, shape, dtype=tf.dtypes.float32, seed=None, name=None
)
lam — это параметр скорости, описывающий распределение(я).
Пример:
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
| Аргументы | |
|---|---|
lam | Тензор или значение Python или N-мерный массив типа dtype. lam предоставляет параметр(ы) скорости, описывающий(ие) распределение(я) Пуассона для выборки. |
shape | Целочисленный тензор 1-й размерности или массив Python. Форма выходных выборок для каждого распределения, заданного параметром «скорость». |
dtype | Тип выходных данных: float16, float32, float64, int32 или int64. |
seed | Целое число Python. Используется для создания случайного начального значения для распределений. См. tf.random.set_seed для получения информации о поведении. |
name | Необязательное имя для операции. |
| Возвращаемые значения | |
|---|---|
samples | Tensor формы tf.concat([shape, tf.shape(lam)], axis=0) со значениями типа dtype. |
© 2020 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/versions/r2.3/api_docs/python/tf/compat/v1/random_poisson