1. Logistic regression模型
我们先看下logistic regression模型及损失函数。有m个样本,,
。Logistic regression采用的sigmoid函数是
损失函数为:
2. Softmax回归模型
Softmax回归用于多类分类,假设有k个分类,则
其中1/ 是为了归一化。
3. 损失函数
Logistic regression的损失函数改个形式变成
根据这个扩展的形式得到softmax的损失函数
所以softmax回归是logistic回归的一般形式。