Given a tensor of values in the range [0, 1], multiplying these values with a scalar p and applying a softmax gives scaled probabilities that sum to 1. Increasing p pushes the values to either 0 or 1. See example:
values = torch.tensor([0.00, 0.25, 0.50, 0.75, 1.00])

softmax_values = torch.stack([torch.softmax(p*values, 0) for p in np.arange(0, 20)])

for input, outputs in zip(values, softmax_values.T):
    c = plt.gca()._get_lines.get_next_color()
    plt.plot([0], [input], 'o', c=c)
    plt.plot(outputs, c=c)

plt.xlabel("p")
    
plt.show()


Dots represent the input values and lines show softmax values of those values given a certain p.
Setting low values of p results in all softmax values converge to 1 / n_values = 1 / 5 = 0.2.
How do I instead create a function that gradually transform the input values to their softmax as p → inf?
That function would look like: