Backpropagation neural network

来源:互联网 发布:python .write 编辑:程序博客网 时间:2024/05/18 00:32

One conviction underlying the book is that it’s better to obtain a solid understanding of the core principles of neural networks and deep learning rather than a hazy understanding of a long laundry list of ideas.

ωljk to denote kth neuron in the (l-1)th to jth neuron in the l layer.

zlj=k(ωljkal1k+blj)

namely,
Zl=WlAl1+Bl

and append with a activation function

Al=σ(Zl)=σ(WlAl1+Bl)

we need to establish a loss function and then optimize it.

C=12nx(y(x)aL(x))2

and we write the quadratic cost for matrix form.

C=0.5||yaL||2

the Hadamard product

st

Optimize

δlj the error on jth neuron on layer l.

δlj=Czlj

and for the last layer L:

  • BP1
    δLj=CzLj=CaLjσ(zLj)

namely

δL=Cσ(zL)

  • BP2
    δl=(ωl+1)Tδl+1σ(zl)

Proof:
1.

δl=Czl

2.
δl+1=Czl+1

so we get
δlj=Czl+1kzl+1kzlj=δl+1k(iωl+1kiali)zlj

and

(iωlkiali)zlj=(iωl+1kiσ(zli))zlj=ωl+1kjσ,(zlk)

we get

δlj=δl+1kωl+1kjσ(zlk)

we write it in matrix form:

δl=1K(ωl+1)Tδl+1σ(zl)

after we get the ωl, we can use it to update the Cω and Cb :

Cωljk=Czljzljωljk=δljalk

and
Cblj=Czlkzlkblk=δlk

the formula to update (ω) in n+1 times :

ω=ωλCω

b=bλCb

thus we get everything.

0 0