In code, it's something like this: # In[7]: def softmax(x): return torch.exp(x) / torch.exp(x).sum() Let's test it on an input vector: x 1 0 1 x1 + x2 x1 x ...
確定! 回上一頁