I am trying to understand the equivalence between the logistic function and the softmax function, when k = 2. My understanding is that the following code should output the same values. Where is my mistake?
def sigmoid(x):
x = np.asarray(x, dtype=np.float)
x = 1 / (1 + np.exp(-x))
return x
def softmax(x):
x = np.asarray(x)
x = np.exp(x)/np.sum(np.exp(x))
return x
x = .5
b1 = 1
b2 = -1
sigmoid(x*b1), sigmoid(x*b2), softmax([x*(b1-b2), x*(b2-b2)])
---
Output> 0.6224593312018546, 0.3775406687981454, array([0.73105858, 0.26894142])
Is it because I am assuming that the softmax optimization would find the same betas?