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-D или 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.4/api_docs/python/tf/compat/v1/random_poisson