olivia
olivia

Reputation: 407

Why tf.multinomial works with negative inputs like [[-1,1]]?

I guess tf.multinomial does sampling based on softmax([[-1,1]]). If you have some ideas, please, tell me.

Upvotes: 1

Views: 161

Answers (1)

P-Gn
P-Gn

Reputation: 24581

That's because tf.multinomial takes log-probabilities as its first argument.

From the docs:

logits: 2-D Tensor with shape [batch_size, num_classes]. Each slice [i, :] represents the unnormalized log-probabilities for all classes.

Upvotes: 1

Related Questions