I'm using a NN created with CNTK's SimpleNetworkBuilder to make choices (specifically in board games). I specified ReLU as the layer type, so outputs can be arbitrary numbers.

When evaluating a custom set of features, getting the "choice" of the function/model is simple: Look for the output signal with the highest value. However, there are times when I wish to introduce some randomness and assign probabilities to each output signal, then select the choice based on each output's probability.

Currently, what I'm doing is manually normalizing all the output using a sigmoid function specified here: https://en.wikipedia.org/wiki/Logistic_function Then, I multiply them all by a scalar such that the sum total of all outputs is 1.

At this point, I pick a random number 0..1, and see where along the map it falls; that is my selected choice.

What I'd like to know is, is there a better way?

  • $\begingroup$ "softmax" function $\endgroup$
    – Kh40tiK
    Mar 14 '17 at 10:05

I would just skip the sigmoid function step.

Consider these two scenarios with three choices with the associated values: 0.1,10,100 or 1,100,1000 Given that these scenarios are equivalent in their relativ values, your probabilities should be assigned in the same way. But if you throw in a sigmoid function, the difference between 10 and 100 will be bigger than between 100 and 1000.

Just normalise the values, so that they sum to 1. In that case the choice with a value ten times higher than the value of another choice will be picked ten times as often. Makes sense to me.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.