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 | Целочисленный тензор или массив Python размерности 1. Форма выходных выборок, извлекаемых из каждого распределения, параметризованного значением «rate». |
dtype | Тип выходных данных: float16, float32, float64, int32 или int64. |
seed | Целое число Python. Используется для создания случайного начального значения для распределений. Описание поведения см. в разделе tf.random.set_seed. |
name | Необязательное имя операции. |
| Возвращает | |
|---|---|
samples | Tensor формы tf.concat([shape, tf.shape(lam)], axis=0) со значениями типа dtype. |
© 2022 The TensorFlow Authors. All rights reserved.
Licensed under the Creative Commons Attribution License 4.0.
Code samples licensed under the Apache 2.0 License.
https://www.tensorflow.org/api_docs/python/tf/compat/v1/random_poisson