return np.mean(-Z[np.indices(y.shape)[0], y] + np.log(np.sum(np.exp(Z), axis=1))) 我自己个人实现的时候写出了这么一版本: def softmax_loss(Z, y): softmax_result = np.exp(Z[range(Z.shape[0]), y]) / np.sum(np.exp(Z), axis=1, keepdims=True) return np.mean(-np.lo...
Files 00a3114 data hw0 hw1 hw2 apps mlp_resnet.py figures python tests data hw2.ipynb hw3 .gitignoreBreadcrumbs dlsyscourse-hw /hw2 /apps / mlp_resnet.py Latest commit Mmmofan init hws 152efe3· Oct 16, 2022 HistoryHistory Breadcrumbs dlsyscourse-hw /hw2 /apps / mlp_...
Repository files navigation README Apache-2.0 license Lecture13 This repo contains the infrastructure code needed for hardware acceleration implementation It can be safely replaced by hw3 repo eventually.About No description, website, or topics provided. Resources Readme License Apache-2.0 license ...