Welcome to our Support Center

Multinomial

Description

Generate a tensor of samples from a multinomial distribution according to the probabilities of each of the possible outcomes.

 

Input parameters

 

specified_outputs_namearray, this parameter lets you manually assign custom names to the output tensors of a node.
input (heterogeneous) – T1 : object, input tensor with shape [batch_size, class_size], where class_size is the number of all possible outcomes. Each value along the axis zero represents the unnormalized log-probability of each corresponding outcome in a batch.

 Parameters : cluster,

dtype : enum, the data type for the elements of the output tensor, if not specified, we will use int32.
Default value “INT32”.
sample_size : integer, number of times to sample.
Default value “1”.
seed : float, seed to the random generator, if not specified we will auto generate one.
Default value “0”.
 training? : boolean, whether the layer is in training mode (can store data for backward).
Default value “True”.
 lda coeff : float, defines the coefficient by which the loss derivative will be multiplied before being sent to the previous layer (since during the backward run we go backwards).
Default value “1”.

 name (optional) : string, name of the node.

Output parameters

 

 output (heterogeneous) – T2 : object, output tensor with shape [batch_size, sample_size], where sample_size is the number of times to sample. Each value along the axis zero represents the outcome of the corresponding sample in a batch.

Type Constraints

T1 in (tensor(double)tensor(float)tensor(float16)) : Constrain input types to float tensors.

T2 in (tensor(int32)tensor(int64)) : Constrain output types to integral tensors.

Example

All these exemples are snippets PNG, you can drop these Snippet onto the block diagram and get the depicted code added to your VI (Do not forget to install Deep Learning library to run it).
Table of Contents