线性回归, 逻辑回归与神经网络公式相似点

线性回归, 逻辑回归与神经网络公式相似点

  • 线性回归与逻辑回归
    • 线性回归的损失函数
      \[ J(\theta)={1\over{2m}}\sum_{i=1}^{m}(h_\theta(x^{(i)})-y^{(i)})^2 \]
    • 逻辑回归的损失函数
    • \[ J(\theta)={-1\over{m}}[\sum_{i=1}^{m}y^{(i)}log(h_\theta(x^{(i)}))+(1-y^{(i)})log(1-h_\theta(x^{(i)}))] \]
    • 线性回归的损失函数的梯度
      \[ {\partial\over{\partial\theta_j}}J(\theta)=\sum_{i=1}^{m}(h_\theta(x^{(i)})-y^{(i)})x_j \]
    • 逻辑回归的损失函数的梯度
      \[ {\partial\over{\partial\theta_j}}J(\theta)=\sum_{i=1}^{m}(h_\theta(x^{(i)})-y^{(i)})x_j \]
  • 逻辑回归与神经网络
    • 逻辑回归的损失函数
      \[ J(\theta)={-1\over{m}}[\sum_{i=1}^{m}y^{(i)}log(h_\theta(x^{(i)}))+(1-y^{(i)})log(1-h_\theta(x^{(i)}))] \]
    • 神经网络的损失函数
      \[ J(\Theta) = {1\over{m}}\sum_{i=1}^{m}\sum_{k=1}^{K} y_k^{(i)}log(h_\Theta(y_k^{(i)})) + (1 - y_k^{(i)})log(1 - h_\Theta(y_k^{(i)})) + {\lambda\over{2m}}\sum_{l}^{L-1}\sum_{i=1}^{s_l}\sum_{j=1}^{s_{l+1}}\Theta_{ji}^{l} \]

猜你喜欢

转载自www.cnblogs.com/megachen/p/10466781.html