{"type":"rich","published":"2026-03-26 01:22:13","title":"Sigmoid and NLL","version":"1.0","height":"190","categories":["DL"],"author_url":"https://blog.hatena.ne.jp/HTN20190109/","url":"https://htn20190109.hatenablog.com/entry/2026/03/26/012213","image_url":null,"author_name":"HTN20190109","width":"100%","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fhtn20190109.hatenablog.com%2Fentry%2F2026%2F03%2F26%2F012213\" title=\"Sigmoid and NLL - 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>","provider_name":"Hatena Blog","blog_url":"https://htn20190109.hatenablog.com/","description":"import numpy as np class Sigmoid: def forward(self, x, w, b): \"\"\" x: (N, D) w: (D,) b: scalar \"\"\" self.x = x self.w = w z = np.dot(x, w) + b # \u2190 \u3053\u3063\u3061\u306e\u65b9\u304c\u5b89\u5168 self.y_pred = 1 / (1 + np.exp(-z)) return self.y_pred def backward(self, dy): \"\"\" dy: (N,) \"\"\" dz = dy * (1.0 - self.y_pred) * self.y_pred # (N,) \u2026","provider_url":"https://hatena.blog","blog_title":"HTN20190109\u306e\u65e5\u8a18"}