目录
当前位置: 首页 > 文档资料 > Edward 中文文档 >

ed.util.compute_multinomial_mode

优质
小牛编辑
125浏览
2023-12-01
compute_multinomial_mode(
    probs,
    total_count=1,
    seed=None
)

Defined in edward/util/random_variables.py.

Compute the mode of a Multinomial random variable.

Args:

  • probs: 1-D Numpy array of Multinomial class probabilities
  • total_count: integer number of trials in single Multinomial draw
  • seed: a Python integer. Used to create a random seed for the distribution

Examples

# returns either [2, 2, 1], [2, 1, 2] or [1, 2, 2]
probs = np.array(3 * [1/3])
total_count = 5
compute_multinomial_mode(probs, total_count)
# returns [3, 2, 0]
probs = np.array(3 * [1/3])
total_count = 5
compute_multinomial_mode(probs, total_count)