DeepLearning101's picture
Upload 21 files
45311fe
raw
history blame
179 Bytes
import torch
"""
Transform the torch logits into probabilities.
"""
def softmax(logits):
probs = torch.softmax(torch.from_numpy(logits).float(), -1).numpy()
return probs