« Minimal Replication »

Home Tags About

3.4.softmax

Published at 2024-08-06
Licensed under CC BY-NC-SA 4.0 notesjulyfun技术学习d2l

回归与分类

回归用于预测多少(房价),而 softmax 用于预测分类。

softmax 函数

softmax 将上一层输出取指数后求和,输出为占和的比重。

框架实现时,softmax 层无需包含于 Sequential 容器中,而是在 loss 中实现。Loss 含有 backward 代码,例如:

https://github.com/julyfun/numpytorch/blob/main/numpytorch/nn/modules/module.py

« Minimal Replication »

Powered by Astro