{"version":"1.0","url":"https://htn20190109.hatenablog.com/entry/2026/05/02/145541","description":"import numpy as np def softmax(x): if x.ndim == 2: x = x - x.max(axis=1, keepdims=True) x = np.exp(x) x /= x.sum(axis=1, keepdims=True) elif x.ndim == 1: x = x - np.max(x) x = np.exp(x) x /= np.sum(x) return x class Softmax: def __init__(self): self.params, self.grads = [],[] self.out = None def for\u2026","image_url":null,"blog_url":"https://htn20190109.hatenablog.com/","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fhtn20190109.hatenablog.com%2Fentry%2F2026%2F05%2F02%2F145541\" title=\"Softmax\u30af\u30e9\u30b9 - HTN20190109\u306e\u65e5\u8a18\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","width":"100%","published":"2026-05-02 14:55:41","author_url":"https://blog.hatena.ne.jp/HTN20190109/","type":"rich","height":"190","provider_name":"Hatena Blog","title":"Softmax\u30af\u30e9\u30b9","categories":["DL"],"provider_url":"https://hatena.blog","blog_title":"HTN20190109\u306e\u65e5\u8a18","author_name":"HTN20190109"}