viswanani's picture
Upload 22 files
1c7bc31 verified
raw
history blame contribute delete
253 Bytes
import yaml
def load_yaml(path):
with open(path, "r", encoding="utf-8") as f:
return yaml.safe_load(f)
def softmax(xs):
import numpy as np
x = np.array(xs, dtype=float)
e = np.exp(x - x.max())
return (e / e.sum()).tolist()