1

I have a distance measure going from 0 to infitiny, where 0 indicates closeness.

I need to perform a transformation in order that the distances sum up to 1. Therefore, softmax seems appropriate, especially that the gap between the values is not constant but increase with the distance, so 1 to 2 is much closer than 9 to 10.

My issue is that I want the opposite to a softmax transformation.

Imagine the following vector x = c(0, 0, 0, 1, 1, 2, 5, 5, 10)

If I apply a softmax transformation (using R)

softmax = round( exp(x) / sum(exp(x)), 2)

I get

0.00 0.00 0.00 0.00 0.00 0.00 0.01 0.01 0.99

But I want the opposite of that, I want the 0 being closest to 1 and so on.

How could I do that?

giac
  • 103

0 Answers0