损失函数

平方差损失函数

$$ l=\frac{1}{2}(y-\hat{y})^{2} $$ $$ L=\frac{1}{2N}\sum_{i=1}^{N} (y^{(i)}-\hat{y}^{(i)})^{2} $$

交叉熵损失函数

$$ l=-y\cdot \log_{2}\hat{y} $$ $$ L=-\frac{1}{N}\sum_{i=1}^{N} y^{(i)}\cdot \log_{2}\hat{y}^{(i)} $$