CNN基础(1)

classification = score function + loss function +optimization

score function

  • linear
  • nonlinear

这里写图片描述
An example of mapping an image to class scores. For the sake of visualization, we assume the image only has 4 pixels (4 monochrome pixels, we are not considering color channels in this example for brevity), and that we have 3 classes (red (cat), green (dog), blue (ship) class). (Clarification: in particular, the colors here simply indicate 3 classes and are not related to the RGB channels.) We stretch the image pixels into a column and perform matrix multiplication to get the scores for each class. Note that this particular set of weights W is not good at all: the weights assign our cat image a very low cat score. In particular, this set of weights seems convinced that it’s looking at a dog.


loss function (cost function, objective)

  • Multicass Support Vector Machine(SVM) loss

    Li=jyimax(0,sjsyi+Δ)    (hinge loss)

  • squared hinge loss

  • cross-entropy loss

    Li=logefyijefjor equivalentlyLi=fyi+logjefj

    where
    fj(z)=ezjkezk

    is called softmax function


the loss function quantifies our unhappiness with predictions on the training set

这里写图片描述

The Multiclass Support Vector Machine “wants” the score of the correct class to be higher than all other scores by at least a margin of delta. If any class has a score inside the red region (or higher), then there will be accumulated loss. Otherwise the loss will be zero. Our objective will be to find the weights that will simultaneously satisfy this constraint for all examples in the training data and give a total loss that is as low as possible.


  • Regularization
    1. L1 Regularization
      R(W)=|W|

    2. L2
      R(W)=klW2k,l

    3. Drop out 这里写图片描述

the full loss becomes:
L=1NiLidata loss+λR(W)regularization loss

optimization

  • Gradient Descent

    • Stochastic Gradient Descent (SGD or on-line gradient descent)

    • Mini-batch Gradient Descent

  • backpropagation


这里写图片描述
An example circuit demonstrating the intuition behind the operations that backpropagation performs during the backward pass in order to compute the gradients on the inputs. Sum operation distributes gradients equally to all its inputs. Max operation routes the gradient to the higher input. Multiply gate takes the input activations, swaps them and multiplies by its gradient.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

此人姓于名叫罩百灵

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值