赞
踩
新权值=当前权值-学习率梯度
zh1=w1×i1+w3×i2+b1×1zh1=w1×i1+w3×i2+b1×1
zh2=w2×i1+w4×i2+b1×1zh2=w2×i1+w4×i2+b1×1
ah2=11+e−zh2ah2=11+e−zh2
ao1=11+e−zo1ao1=11+e−zo1
ao2=11+e−zo2ao2=11+e−zo2
=ao2×(1−ao2)=ao2×(1−ao2)
∂zo1∂w7=ah2∂zo1∂w7=ah2
∂zo2∂w6=ah1∂zo2∂w6=ah1
∂zo2∂w8=ah2∂zo2∂w8=ah2
∂Etotal∂w5=∂Etotal∂ao1×∂ao1∂zo1×∂zo1∂w5=(ao1−targeto1)×ao1×(1−ao1)×ah1∂Etotal∂w5=∂Etotal∂ao1×∂ao1∂zo1×∂zo1∂w5=(ao1−targeto1)×ao1×(1−ao1)×ah1
∂Etotal∂w7=∂Etotal∂ao1×∂ao1∂zo1×∂zo1∂w7=(ao1−targeto1)×ao1×(1−ao1)×ah2∂Etotal∂w7=∂Etotal∂ao1×∂ao1∂zo1×∂zo1∂w7=(ao1−targeto1)×ao1×(1−ao1)×ah2
∂Etotal∂w6=∂Etotal∂ao2×∂ao2∂zo2×∂zo2∂w6=(ao2−targeto2)×ao2×(1−ao2)×ah1∂Etotal∂w6=∂Etotal∂ao2×∂ao2∂zo2×∂zo2∂w6=(ao2−targeto2)×ao2×(1−ao2)×ah1
∂Etotal∂w8=∂Etotal∂ao2×∂ao2∂zo2×∂zo2∂w8=(ao2−targeto2)×ao2×(1−ao2)×ah2∂Etotal∂w8=∂Etotal∂ao2×∂ao2∂zo2×∂zo2∂w8=(ao2−targeto2)×ao2×(1−ao2)×ah2
δo1=∂Etotal∂ao1×∂ao1∂zo1=∂Etotal∂zo1=(ao1−targeto1)×ao1×(1−ao1)δo1=∂Etotal∂ao1×∂ao1∂zo1=∂Etotal∂zo1=(ao1−targeto1)×ao1×(1−ao1)
δo2=∂Etotal∂ao2×∂ao2∂zo2=∂Etotal∂zo2=(ao2−targeto2)×ao2×(1−ao2)δo2=∂Etotal∂ao2×∂ao2∂zo2=∂Etotal∂zo2=(ao2−targeto2)×ao2×(1−ao2)
∂Etotal∂w5=∂Etotal∂ao1×∂ao1∂zo1×∂zo1∂w5=δo1×ah1∂Etotal∂w5=∂Etotal∂ao1×∂ao1∂zo1×∂zo1∂w5=δo1×ah1
∂Etotal∂w7=∂Etotal∂ao1×∂ao1∂zo1×∂zo1∂w7=δo1×ah2∂Etotal∂w7=∂Etotal∂ao1×∂ao1∂zo1×∂zo1∂w7=δo1×ah2
∂Etotal∂w6=∂Etotal∂ao2×∂ao2∂zo2×∂zo2∂w6=δo2×ah1∂Etotal∂w6=∂Etotal∂ao2×∂ao2∂zo2×∂zo2∂w6=δo2×ah1
∂Etotal∂w8=∂Etotal∂ao2×∂ao2∂zo2×∂zo2∂w8=δo2×ah2∂Etotal∂w8=∂Etotal∂ao2×∂ao2∂zo2×∂zo2∂w8=δo2×ah2
w+5=w5−η×∂Etotal∂w5=w5−η×δo1×ah1w5+=w5−η×∂Etotal∂w5=w5−η×δo1×ah1
w+7=w7−η×∂Etotal∂w7=w7−η×δo1×ah2w7+=w7−η×∂Etotal∂w7=w7−η×δo1×ah2
w+6=w6−η×∂Etotal∂w6=w6−η×δo2×ah1w6+=w6−η×∂Etotal∂w6=w6−η×δo2×ah1
w+8=w8−η×∂Etotal∂w8=w8−η×δo2×ah2w8+=w8−η×∂Etotal∂w8=w8−η×δo2×ah2
∂Etotal∂w1=∂Etotal∂ah1×∂ah1∂zh1×∂zh1∂w1∂Etotal∂w1=∂Etotal∂ah1×∂ah1∂zh1×∂zh1∂w1
=(∂Eo1∂ah1+∂Eo2∂ah1)×∂ah1∂zh1×∂zh1∂w1=(∂Eo1∂ah1+∂Eo2∂ah1)×∂ah1∂zh1×∂zh1∂w1
=(∂Eo1∂ah1+∂Eo2∂ah1)×∂ah1∂zh1×i1=(∂Eo1∂ah1+∂Eo2∂ah1)×∂ah1∂zh1×i1
=δh1×i1=δh1×i1
∂Etotal∂w3=∂Etotal∂ah1×∂ah1∂zh1×∂zh1∂w3∂Etotal∂w3=∂Etotal∂ah1×∂ah1∂zh1×∂zh1∂w3
=(∂Eo1∂ah1+∂Eo2∂ah1)×∂ah1∂zh1×i2=(∂Eo1∂ah1+∂Eo2∂ah1)×∂ah1∂zh1×i2
=δh1×i2=δh1×i2
∂Etotal∂w2=∂Etotal∂ah2×∂ah2∂zh2×∂zh2∂w2∂Etotal∂w2=∂Etotal∂ah2×∂ah2∂zh2×∂zh2∂w2
=(∂Eo1∂ah2+∂Eo2∂ah2)×∂ah2∂zh2×∂zh2∂w2=(∂Eo1∂ah2+∂Eo2∂ah2)×∂ah2∂zh2×∂zh2∂w2
=(∂Eo1∂ah2+∂Eo2∂ah2)×∂ah2∂zh2×i1=(∂Eo1∂ah2+∂Eo2∂ah2)×∂ah2∂zh2×i1
=δh2×i1=δh2×i1
∂Etotal∂w4=∂Etotal∂ah2×∂ah2∂zh2×∂zh2∂w4∂Etotal∂w4=∂Etotal∂ah2×∂ah2∂zh2×∂zh2∂w4
=(∂Eo1∂ah2+∂Eo2∂ah2)×∂ah2∂zh2×∂zh2∂w4=(∂Eo1∂ah2+∂Eo2∂ah2)×∂ah2∂zh2×∂zh2∂w4
=(∂Eo1∂ah2+∂Eo2∂ah2)×∂ah2∂zh2×i2=(∂Eo1∂ah2+∂Eo2∂ah2)×∂ah2∂zh2×i2
=δh2×i2=δh2×i2
∂Eo1∂ah1=∂Eo1∂ao1×∂ao1∂zo1×∂zo1∂ah1=(ao1−targeto1)×ao1×(1−ao1)×w5∂Eo1∂ah1=∂Eo1∂ao1×∂ao1∂zo1×∂zo1∂ah1=(ao1−targeto1)×ao1×(1−ao1)×w5
∂Eo2∂ah1=∂Eo2∂ao2×∂ao2∂zo2×∂zo2∂ah1=(ao2−targeto2)×ao2×(1−ao2)×w6∂Eo2∂ah1=∂Eo2∂ao2×∂ao2∂zo2×∂zo2∂ah1=(ao2−targeto2)×ao2×(1−ao2)×w6
∂Eo1∂ah2=∂Eo1∂ao1×∂ao1∂zo1×∂zo1∂ah2=(ao1−targeto1)×ao1×(1−ao1)×w7∂Eo1∂ah2=∂Eo1∂ao1×∂ao1∂zo1×∂zo1∂ah2=(ao1−targeto1)×ao1×(1−ao1)×w7
∂Eo2∂ah2=∂Eo2∂ao2×∂ao2∂zo2×∂zo2∂ah2=(ao2−targeto2)×ao2×(1−ao2)×w8∂Eo2∂ah2=∂Eo2∂ao2×∂ao2∂zo2×∂zo2∂ah2=(ao2−targeto2)×ao2×(1−ao2)×w8
δh1=[(ao1−targeto1)×ao1×(1−ao1)×w5δh1=[(ao1−targeto1)×ao1×(1−ao1)×w5
+(ao2−targeto2)×ao2×(1−ao2)×w6]×ah1×(1−ah1)+(ao2−targeto2)×ao2×(1−ao2)×w6]×ah1×(1−ah1)
δh2=[(ao1−targeto1)×ao1×(1−ao1)×w7δh2=[(ao1−targeto1)×ao1×(1−ao1)×w7
+(ao2−targeto2)×ao2×(1−ao2)×w8]×ah2×(1−ah2)+(ao2−targeto2)×ao2×(1−ao2)×w8]×ah2×(1−ah2)
w+1=w1−η×∂Etotal∂w1=w1−η×δh1×i1w1+=w1−η×∂Etotal∂w1=w1−η×δh1×i1
w+3=w3−η×∂Etotal∂w3=w3−η×δh1×i2w3+=w3−η×∂Etotal∂w3=w3−η×δh1×i2
w+2=w2−η×∂Etotal∂w2=w2−η×δh2×i1w2+=w2−η×∂Etotal∂w2=w2−η×δh2×i1
w+4=w4−η×∂Etotal∂w4=w4−η×δh2×i2w4+=w4−η×∂Etotal∂w4=w4−η×δh2×i2
=0.16×0.07+0.30×0.12+0.4×1=0.16×0.07+0.30×0.12+0.4×1
=0.4472=0.4472
=0.25×0.07+0.35×0.12+0.4×1=0.25×0.07+0.35×0.12+0.4×1
=0.4595=0.4595
=11+e−0.4472=0.26894142136=11+e−0.4472=0.26894142136
=11+e−0.4595=0.26894142136=11+e−0.4595=0.26894142136
=0.38×0.26894142136+0.52×0.26894142136+0.49×1=0.38×0.26894142136+0.52×0.26894142136+0.49×1
=0.732047279224=0.732047279224
=0.47×0.26894142136+0.58×0.26894142136+0.49×1=0.47×0.26894142136+0.58×0.26894142136+0.49×1
=0.772388492428=0.772388492428
=11+e−0.732047279224=0.26894142136=11+e−0.732047279224=0.26894142136
=11+e−0.772388492428=0.26894142136=11+e−0.772388492428=0.26894142136
=12(0.04−0.26894142136)2=0.02620708721=12(0.04−0.26894142136)2=0.02620708721
=12(0.89−0.26894142136)2=0.19285687905=12(0.89−0.26894142136)2=0.19285687905
=0.02620708721+0.19285687905=0.02620708721+0.19285687905
=0.21906396626=0.21906396626
=(0.26894142136−0.04)×0.26894142136×(1−0.26894142136)=(0.26894142136−0.04)×0.26894142136×(1−0.26894142136)
=0.04501261545=0.04501261545
=(0.26894142136−0.89)×0.26894142136×(1−0.26894142136)=(0.26894142136−0.89)×0.26894142136×(1−0.26894142136)
=−0.12210752779=−0.12210752779
=0.38−0.5×0.04501261545×0.26894142136=0.38−0.5×0.04501261545×0.26894142136
=0.37394712161=0.37394712161
=0.52−0.5×0.04501261545×0.26894142136=0.52−0.5×0.04501261545×0.26894142136
=0.51394712161=0.51394712161
=0.47+0.5×0.12210752779×0.26894142136=0.47+0.5×0.12210752779×0.26894142136
=0.48641988604=0.48641988604
=0.58+0.5×0.12210752779×0.26894142136=0.58+0.5×0.12210752779×0.26894142136
=0.59641988604=0.59641988604
=[(0.26894142136−0.04)×0.26894142136×(1−0.26894142136)×0.38=[(0.26894142136−0.04)×0.26894142136×(1−0.26894142136)×0.38
+(0.26894142136−0.89)×0.26894142136×(1−0.26894142136)×0.47]×0.26894142136×(1−0.26894142136)+(0.26894142136−0.89)×0.26894142136×(1−0.26894142136)×0.47]×0.26894142136×(1−0.26894142136)
=[0.00247678776−0.16702837688]×0.19661193323=[0.00247678776−0.16702837688]×0.19661193323
=−0.03235280605=−0.03235280605
=[(0.26894142136−0.04)×0.26894142136×(1−0.26894142136)×0.52=[(0.26894142136−0.04)×0.26894142136×(1−0.26894142136)×0.52
+(0.26894142136−0.89)×0.26894142136×(1−0.26894142136)×0.58]×0.26894142136×(1−0.26894142136)+(0.26894142136−0.89)×0.26894142136×(1−0.26894142136)×0.58]×0.26894142136×(1−0.26894142136)
=[0.00338928851−0.20612012466]×0.19661193323=[0.00338928851−0.20612012466]×0.19661193323
=−0.03985930162=−0.03985930162
=0.16+0.5×0.03235280605×0.07=0.16+0.5×0.03235280605×0.07
=0.16113234821=0.16113234821
=0.30+0.5×0.03235280605×0.12=0.30+0.5×0.03235280605×0.12
=0.30194116836=0.30194116836
=0.25+0.5×0.03985930162×0.07=0.25+0.5×0.03985930162×0.07
=0.25139507556=0.25139507556
=0.35+0.5×0.03985930162×0.12=0.35+0.5×0.03985930162×0.12
=0.35239155809=0.35239155809
Si=eVi∑jeVjSi=eVi∑jeVj