[{"data":1,"prerenderedAt":795},["ShallowReactive",2],{"content-query-Ddd9PxAs2c":3},{"_path":4,"_dir":5,"_draft":6,"_partial":6,"_locale":7,"title":8,"description":9,"date":10,"cover":11,"type":12,"category":13,"body":14,"_type":789,"_id":790,"_source":791,"_file":792,"_stem":793,"_extension":794},"/technology-blogs/zh/817","zh",false,"","【MindSpore易点通】深度学习系列-深度学习网络","跟着小Mi一起深度学习，让我们一起有温度、有态度、有深度地学习！","2021-12-03","https://obs-mindspore-file.obs.cn-north-4.myhuaweicloud.com/file/2022/05/30/9e25658c295a46daa863e6ceef5a0830.png","technology-blogs","基础知识",{"type":15,"children":16,"toc":780},"root",[17,25,31,41,53,60,65,72,77,84,89,98,103,110,115,123,134,141,146,153,158,165,188,195,205,212,220,225,230,239,248,264,271,279,284,289,294,301,316,321,326,333,338,345,350,357,380,391,398,414,421,437,444,458,465,496,503,513,530,537,542,549,564,571,591,599,604,625,640,654,659,669,684,699,708,723,748,755,770,775],{"type":18,"tag":19,"props":20,"children":22},"element","h1",{"id":21},"mindspore易点通深度学习系列-深度学习网络",[23],{"type":24,"value":8},"text",{"type":18,"tag":26,"props":27,"children":28},"p",{},[29],{"type":24,"value":30},"好久不见，甚是想念！小Mi最近一直在忙着消化深度学习的各种知识点，这不就马不停蹄地就给大家安排上啦！今天小Mi给大家介绍简单的深度学习网络（Deep Neural Networks， DNN），废话不多说，赶紧开始吧~",{"type":18,"tag":32,"props":33,"children":35},"h2",{"id":34},"感知机",[36],{"type":18,"tag":37,"props":38,"children":39},"strong",{},[40],{"type":24,"value":34},{"type":18,"tag":26,"props":42,"children":43},{},[44,46,51],{"type":24,"value":45},"首先隆重介绍下神经网络的基础单元——感知机，整体过程就是对若干输入进行加权求和，再加上偏置值，最后通过激活函数",{"type":18,"tag":47,"props":48,"children":50},"img",{"alt":7,"src":49},"https://bbs-img.huaweicloud.com/data/forums/attachment/forum/202112/06/1432492xg84uvketbpwr6z.png",[],{"type":24,"value":52},"得到神经元的输出:",{"type":18,"tag":26,"props":54,"children":55},{},[56],{"type":18,"tag":47,"props":57,"children":59},{"alt":7,"src":58},"https://bbs-img.huaweicloud.com/data/forums/attachment/forum/202112/06/143307q13gynj04huu6l3n.png",[],{"type":18,"tag":26,"props":61,"children":62},{},[63],{"type":24,"value":64},"中间输出结果：",{"type":18,"tag":26,"props":66,"children":67},{},[68],{"type":18,"tag":47,"props":69,"children":71},{"alt":7,"src":70},"https://bbs-img.huaweicloud.com/data/forums/attachment/forum/202112/06/143328i2hk61f5nhjtr8kj.png",[],{"type":18,"tag":26,"props":73,"children":74},{},[75],{"type":24,"value":76},"最后通过某一种神经元激活函数，如：",{"type":18,"tag":26,"props":78,"children":79},{},[80],{"type":18,"tag":47,"props":81,"children":83},{"alt":7,"src":82},"https://bbs-img.huaweicloud.com/data/forums/attachment/forum/202112/06/1433450h29s0mlq3fq7v0n.png",[],{"type":18,"tag":26,"props":85,"children":86},{},[87],{"type":24,"value":88},"该模型的输出结果只能为1或-1，可用于简单二元分类。",{"type":18,"tag":32,"props":90,"children":92},{"id":91},"dnn基本结构",[93],{"type":18,"tag":37,"props":94,"children":95},{},[96],{"type":24,"value":97},"DNN基本结构",{"type":18,"tag":26,"props":99,"children":100},{},[101],{"type":24,"value":102},"在介绍深度学习的过程中其实小Mi已经跟大家介绍过深度学习网络的大致模型，分别由输入层、隐藏层和输出层，而DNN简单来说就是拥有很多隐藏层的神经网络。",{"type":18,"tag":26,"props":104,"children":105},{},[106],{"type":18,"tag":47,"props":107,"children":109},{"alt":7,"src":108},"https://bbs-img.huaweicloud.com/data/forums/attachment/forum/202112/06/143426lmvvx3hexkxl1x6q.png",[],{"type":18,"tag":26,"props":111,"children":112},{},[113],{"type":24,"value":114},"深度神经网络中层与层是全连接的关系，即，第i层的任意神经元一定与第i+1层的任意一个神经元相连。",{"type":18,"tag":32,"props":116,"children":118},{"id":117},"前向传播算法",[119],{"type":18,"tag":37,"props":120,"children":121},{},[122],{"type":24,"value":117},{"type":18,"tag":26,"props":124,"children":125},{},[126,128,132],{"type":24,"value":127},"假设激活函数",{"type":18,"tag":47,"props":129,"children":131},{"alt":7,"src":130},"https://bbs-img.huaweicloud.com/data/forums/attachment/forum/202112/06/143520uzialdwzyxiwhwrm.png",[],{"type":24,"value":133},"，下图中的DNN前向传播算法公式可以直接求得：",{"type":18,"tag":26,"props":135,"children":136},{},[137],{"type":18,"tag":47,"props":138,"children":140},{"alt":7,"src":139},"https://bbs-img.huaweicloud.com/data/forums/attachment/forum/202112/06/1435430yhlzmrkbreacrgc.png",[],{"type":18,"tag":26,"props":142,"children":143},{},[144],{"type":24,"value":145},"第二层输出：",{"type":18,"tag":26,"props":147,"children":148},{},[149],{"type":18,"tag":47,"props":150,"children":152},{"alt":7,"src":151},"https://bbs-img.huaweicloud.com/data/forums/attachment/forum/202112/06/143603ot5hgisaylfueqwr.png",[],{"type":18,"tag":26,"props":154,"children":155},{},[156],{"type":24,"value":157},"第三层输出：",{"type":18,"tag":26,"props":159,"children":160},{},[161],{"type":18,"tag":47,"props":162,"children":164},{"alt":7,"src":163},"https://bbs-img.huaweicloud.com/data/forums/attachment/forum/202112/06/143644hhf7t52fj1eke4ib.png",[],{"type":18,"tag":26,"props":166,"children":167},{},[168,170,174,176,180,182,186],{"type":24,"value":169},"最后根据数学归纳法（这个很重要，本文中运用到好几次），可以得出，假设第",{"type":18,"tag":47,"props":171,"children":173},{"alt":7,"src":172},"https://bbs-img.huaweicloud.com/data/forums/attachment/forum/202112/06/143744slosq34pt8o5k30y.png",[],{"type":24,"value":175},"层有m个神经元，则第",{"type":18,"tag":47,"props":177,"children":179},{"alt":7,"src":178},"https://bbs-img.huaweicloud.com/data/forums/attachment/forum/202112/06/1438261us3txuumitl9wba.png",[],{"type":24,"value":181},"层的第j个神经元的输出",{"type":18,"tag":47,"props":183,"children":185},{"alt":7,"src":184},"https://bbs-img.huaweicloud.com/data/forums/attachment/forum/202112/06/1438484ysk29hq3kptjlpv.png",[],{"type":24,"value":187},"为：",{"type":18,"tag":26,"props":189,"children":190},{},[191],{"type":18,"tag":47,"props":192,"children":194},{"alt":7,"src":193},"https://bbs-img.huaweicloud.com/data/forums/attachment/forum/202112/06/143904aeedunhmyb3keko5.png",[],{"type":18,"tag":26,"props":196,"children":197},{},[198,200,203],{"type":24,"value":199},"这个时候矩阵也可以发挥巨大的作用啦~用矩阵法表示（所有的都可以看成是一个矩阵），第",{"type":18,"tag":47,"props":201,"children":202},{"alt":7,"src":178},[],{"type":24,"value":204},"层的输出为：",{"type":18,"tag":26,"props":206,"children":207},{},[208],{"type":18,"tag":47,"props":209,"children":211},{"alt":7,"src":210},"https://bbs-img.huaweicloud.com/data/forums/attachment/forum/202112/06/143936d2ddm05vkeswd5bo.png",[],{"type":18,"tag":32,"props":213,"children":215},{"id":214},"代码思想",[216],{"type":18,"tag":37,"props":217,"children":218},{},[219],{"type":24,"value":214},{"type":18,"tag":26,"props":221,"children":222},{},[223],{"type":24,"value":224},"简单来说，前向传播算法就是对若干输入进行加权求和，再加上偏置值，最后通过激活函数，进行线性运算和激活运算，从第一层开始一层层向后计算。",{"type":18,"tag":26,"props":226,"children":227},{},[228],{"type":24,"value":229},"输入: 总层数L，隐藏层、输出层的对应矩阵W,偏倚向量b，输入向量x",{"type":18,"tag":26,"props":231,"children":232},{},[233,235],{"type":24,"value":234},"输出：输出层输出",{"type":18,"tag":47,"props":236,"children":238},{"alt":7,"src":237},"https://bbs-img.huaweicloud.com/data/forums/attachment/forum/202112/06/144229xqbhuaj9miy61tpp.png",[],{"type":18,"tag":26,"props":240,"children":241},{},[242,244],{"type":24,"value":243},"1)初始化",{"type":18,"tag":47,"props":245,"children":247},{"alt":7,"src":246},"https://bbs-img.huaweicloud.com/data/forums/attachment/forum/202112/06/144249dlfzc0ujmyesmni4.png",[],{"type":18,"tag":26,"props":249,"children":250},{},[251,253,257,259,262],{"type":24,"value":252},"2)for ",{"type":18,"tag":47,"props":254,"children":256},{"alt":7,"src":255},"https://bbs-img.huaweicloud.com/data/forums/attachment/forum/202112/06/144307ckbtfa1jpap63v8i.png",[],{"type":24,"value":258},"，计算并输出",{"type":18,"tag":47,"props":260,"children":261},{"alt":7,"src":237},[],{"type":24,"value":263},"：",{"type":18,"tag":26,"props":265,"children":266},{},[267],{"type":18,"tag":47,"props":268,"children":270},{"alt":7,"src":269},"https://bbs-img.huaweicloud.com/data/forums/attachment/forum/202112/06/1443260zmqowpqj0v6ckmn.png",[],{"type":18,"tag":32,"props":272,"children":274},{"id":273},"反向传播",[275],{"type":18,"tag":37,"props":276,"children":277},{},[278],{"type":24,"value":273},{"type":18,"tag":26,"props":280,"children":281},{},[282],{"type":24,"value":283},"之前小Mi给大家介绍过机器学习算法，用一个合适的损失函数来度量训练样本的输出损失，接着对这个损失函数进行优化求最小化的极值，大家是不是对这个并不陌生？！对DNN的损失函数用梯度下降法进行迭代优化求极小值的过程就是反向传播算法。",{"type":18,"tag":26,"props":285,"children":286},{},[287],{"type":24,"value":288},"在进行DNN反向传播算法前，需要选择一个损失函数，来度量训练样本计算出的输出和真实的训练样本输出之间的损失。",{"type":18,"tag":26,"props":290,"children":291},{},[292],{"type":24,"value":293},"这里选用最常见的均方差来度量损失。即对于每个样本，期望最小化：",{"type":18,"tag":26,"props":295,"children":296},{},[297],{"type":18,"tag":47,"props":298,"children":300},{"alt":7,"src":299},"https://bbs-img.huaweicloud.com/data/forums/attachment/forum/202112/06/144351rxyackatsc58youd.png",[],{"type":18,"tag":26,"props":302,"children":303},{},[304,308,310,314],{"type":18,"tag":47,"props":305,"children":307},{"alt":7,"src":306},"https://bbs-img.huaweicloud.com/data/forums/attachment/forum/202112/06/144432whwrg3tei5uqmdwx.png",[],{"type":24,"value":309},"和y均为向量，而",{"type":18,"tag":47,"props":311,"children":313},{"alt":7,"src":312},"https://bbs-img.huaweicloud.com/data/forums/attachment/forum/202112/06/1445571nmcipggdtp6tjun.png",[],{"type":24,"value":315},"为S的L2范数。",{"type":18,"tag":26,"props":317,"children":318},{},[319],{"type":24,"value":320},"那么便可以用梯度下降法迭代求解每一层的W,b啦。",{"type":18,"tag":26,"props":322,"children":323},{},[324],{"type":24,"value":325},"输出层第L层，输出层的W，b满足：",{"type":18,"tag":26,"props":327,"children":328},{},[329],{"type":18,"tag":47,"props":330,"children":332},{"alt":7,"src":331},"https://bbs-img.huaweicloud.com/data/forums/attachment/forum/202112/06/144616p2axeluhvmugvmjm.png",[],{"type":18,"tag":26,"props":334,"children":335},{},[336],{"type":24,"value":337},"对于输出层的参数，损失函数为：",{"type":18,"tag":26,"props":339,"children":340},{},[341],{"type":18,"tag":47,"props":342,"children":344},{"alt":7,"src":343},"https://bbs-img.huaweicloud.com/data/forums/attachment/forum/202112/06/144648fhwb9bbs2uzaerqy.png",[],{"type":18,"tag":26,"props":346,"children":347},{},[348],{"type":24,"value":349},"求解W,b的梯度：",{"type":18,"tag":26,"props":351,"children":352},{},[353],{"type":18,"tag":47,"props":354,"children":356},{"alt":7,"src":355},"https://bbs-img.huaweicloud.com/data/forums/attachment/forum/202112/06/144710uzzkrbjxiufdazwp.png",[],{"type":18,"tag":26,"props":358,"children":359},{},[360,362,366,368,372,374,378],{"type":24,"value":361},"符号⊙表示Hadamard积，对于两个维度相同的向量A",{"type":18,"tag":47,"props":363,"children":365},{"alt":7,"src":364},"https://bbs-img.huaweicloud.com/data/forums/attachment/forum/202112/06/144736zx49lvo6spgiutrd.png",[],{"type":24,"value":367},"和B",{"type":18,"tag":47,"props":369,"children":371},{"alt":7,"src":370},"https://bbs-img.huaweicloud.com/data/forums/attachment/forum/202112/06/144751jifks9mfe8vcuhrr.png",[],{"type":24,"value":373},"，则A⊙B=",{"type":18,"tag":47,"props":375,"children":377},{"alt":7,"src":376},"https://bbs-img.huaweicloud.com/data/forums/attachment/forum/202112/06/144805wkrukr8tshcuhfdk.png",[],{"type":24,"value":379},"。",{"type":18,"tag":26,"props":381,"children":382},{},[383,385,389],{"type":24,"value":384},"先对",{"type":18,"tag":47,"props":386,"children":388},{"alt":7,"src":387},"https://bbs-img.huaweicloud.com/data/forums/attachment/forum/202112/06/144839ko9pi9sa57qejmip.png",[],{"type":24,"value":390},"进行计算：",{"type":18,"tag":26,"props":392,"children":393},{},[394],{"type":18,"tag":47,"props":395,"children":397},{"alt":7,"src":396},"https://bbs-img.huaweicloud.com/data/forums/attachment/forum/202112/06/144857lyboiwcp0ogmgtwa.png",[],{"type":18,"tag":26,"props":399,"children":400},{},[401,403,407,409,412],{"type":24,"value":402},"计算出输出层的梯度，然后一层一层递推，第",{"type":18,"tag":47,"props":404,"children":406},{"alt":7,"src":405},"https://bbs-img.huaweicloud.com/data/forums/attachment/forum/202112/06/144923vspjijwwl5ttnqf8.png",[],{"type":24,"value":408},"层的未激活输出",{"type":18,"tag":47,"props":410,"children":411},{"alt":7,"src":387},[],{"type":24,"value":413},"梯度可以表示为:",{"type":18,"tag":26,"props":415,"children":416},{},[417],{"type":18,"tag":47,"props":418,"children":420},{"alt":7,"src":419},"https://bbs-img.huaweicloud.com/data/forums/attachment/forum/202112/06/144952no009k4kbskxxyxy.png",[],{"type":18,"tag":26,"props":422,"children":423},{},[424,426,429,431,435],{"type":24,"value":425},"根据前向传播算法，第",{"type":18,"tag":47,"props":427,"children":428},{"alt":7,"src":405},[],{"type":24,"value":430},"层的",{"type":18,"tag":47,"props":432,"children":434},{"alt":7,"src":433},"https://bbs-img.huaweicloud.com/data/forums/attachment/forum/202112/06/145037lwq460cbytha6ok3.png",[],{"type":24,"value":436},"关系可以知道：",{"type":18,"tag":26,"props":438,"children":439},{},[440],{"type":18,"tag":47,"props":441,"children":443},{"alt":7,"src":442},"https://bbs-img.huaweicloud.com/data/forums/attachment/forum/202112/06/145056mmvg3jawxsmmjncg.png",[],{"type":18,"tag":26,"props":445,"children":446},{},[447,449,452,453,456],{"type":24,"value":448},"而第",{"type":18,"tag":47,"props":450,"children":451},{"alt":7,"src":405},[],{"type":24,"value":430},{"type":18,"tag":47,"props":454,"children":455},{"alt":7,"src":433},[],{"type":24,"value":457},"梯度如下：",{"type":18,"tag":26,"props":459,"children":460},{},[461],{"type":18,"tag":47,"props":462,"children":464},{"alt":7,"src":463},"https://bbs-img.huaweicloud.com/data/forums/attachment/forum/202112/06/145132e2uoy04zhhlsgc8m.png",[],{"type":18,"tag":26,"props":466,"children":467},{},[468,470,474,476,480,481,485,487,490,491,494],{"type":24,"value":469},"接着求出",{"type":18,"tag":47,"props":471,"children":473},{"alt":7,"src":472},"https://bbs-img.huaweicloud.com/data/forums/attachment/forum/202112/06/1452034ew9f27gi7utlu4k.png",[],{"type":24,"value":475},"，又一次采用数学归纳法，假设第",{"type":18,"tag":47,"props":477,"children":479},{"alt":7,"src":478},"https://bbs-img.huaweicloud.com/data/forums/attachment/forum/202112/06/145217ttnqhqkgtwbikutv.png",[],{"type":24,"value":430},{"type":18,"tag":47,"props":482,"children":484},{"alt":7,"src":483},"https://bbs-img.huaweicloud.com/data/forums/attachment/forum/202112/06/145237udowjdp3qnwch09q.png",[],{"type":24,"value":486},"已知，那么我们如何求出第",{"type":18,"tag":47,"props":488,"children":489},{"alt":7,"src":405},[],{"type":24,"value":430},{"type":18,"tag":47,"props":492,"children":493},{"alt":7,"src":472},[],{"type":24,"value":495},"呢？",{"type":18,"tag":26,"props":497,"children":498},{},[499],{"type":18,"tag":47,"props":500,"children":502},{"alt":7,"src":501},"https://bbs-img.huaweicloud.com/data/forums/attachment/forum/202112/06/145315vqwsavrf2ntxumq1.png",[],{"type":18,"tag":26,"props":504,"children":505},{},[506,508,512],{"type":24,"value":507},"可见，现在关键在于求解",{"type":18,"tag":47,"props":509,"children":511},{"alt":7,"src":510},"https://bbs-img.huaweicloud.com/data/forums/attachment/forum/202112/06/145335ept7dij9xllvvax1.png",[],{"type":24,"value":379},{"type":18,"tag":26,"props":514,"children":515},{},[516,518,522,524,528],{"type":24,"value":517},"而",{"type":18,"tag":47,"props":519,"children":521},{"alt":7,"src":520},"https://bbs-img.huaweicloud.com/data/forums/attachment/forum/202112/06/1453541d2dnslpv7g7tqxf.png",[],{"type":24,"value":523},"和",{"type":18,"tag":47,"props":525,"children":527},{"alt":7,"src":526},"https://bbs-img.huaweicloud.com/data/forums/attachment/forum/202112/06/145420v43rj10xeqcdhiie.png",[],{"type":24,"value":529},"的关系其实很容易找出：",{"type":18,"tag":26,"props":531,"children":532},{},[533],{"type":18,"tag":47,"props":534,"children":536},{"alt":7,"src":535},"https://bbs-img.huaweicloud.com/data/forums/attachment/forum/202112/06/145432t6awkhzaj57rxjs1.png",[],{"type":18,"tag":26,"props":538,"children":539},{},[540],{"type":24,"value":541},"这样很容易求出：",{"type":18,"tag":26,"props":543,"children":544},{},[545],{"type":18,"tag":47,"props":546,"children":548},{"alt":7,"src":547},"https://bbs-img.huaweicloud.com/data/forums/attachment/forum/202112/06/145450cd9m1s4p0ua2c4f7.png",[],{"type":18,"tag":26,"props":550,"children":551},{},[552,554,558,559,562],{"type":24,"value":553},"将上式带入上面",{"type":18,"tag":47,"props":555,"children":557},{"alt":7,"src":556},"https://bbs-img.huaweicloud.com/data/forums/attachment/forum/202112/06/14551623pnxzzlcfkhs1fk.png",[],{"type":24,"value":523},{"type":18,"tag":47,"props":560,"children":561},{"alt":7,"src":472},[],{"type":24,"value":563},"关系式得到：",{"type":18,"tag":26,"props":565,"children":566},{},[567],{"type":18,"tag":47,"props":568,"children":570},{"alt":7,"src":569},"https://bbs-img.huaweicloud.com/data/forums/attachment/forum/202112/06/145540ivoql7kpytyt97ui.png",[],{"type":18,"tag":26,"props":572,"children":573},{},[574,576,579,581,584,586,589],{"type":24,"value":575},"得到了",{"type":18,"tag":47,"props":577,"children":578},{"alt":7,"src":472},[],{"type":24,"value":580},"的递推关系式，只要求出了某一层的",{"type":18,"tag":47,"props":582,"children":583},{"alt":7,"src":472},[],{"type":24,"value":585},"，求解",{"type":18,"tag":47,"props":587,"children":588},{"alt":7,"src":433},[],{"type":24,"value":590},"的对应梯度就很简单啦。",{"type":18,"tag":32,"props":592,"children":594},{"id":593},"代码思路",[595],{"type":18,"tag":37,"props":596,"children":597},{},[598],{"type":24,"value":593},{"type":18,"tag":26,"props":600,"children":601},{},[602],{"type":24,"value":603},"由于梯度下降法有批量（Batch），小批量(mini-Batch)，随机三个变种，这里小Mi选用最基本的批量梯度下降法来描述反向传播算法。",{"type":18,"tag":26,"props":605,"children":606},{},[607,609,613,615,619,621],{"type":24,"value":608},"输入: 总层数L，各隐藏层与输出层的神经元个数，激活函数，损失函数，迭代步长",{"type":18,"tag":47,"props":610,"children":612},{"alt":7,"src":611},"https://bbs-img.huaweicloud.com/data/forums/attachment/forum/202112/06/145631igozbzvonwkifyog.png",[],{"type":24,"value":614},"，最大迭代次数MAX与停止迭代阈值",{"type":18,"tag":47,"props":616,"children":618},{"alt":7,"src":617},"https://bbs-img.huaweicloud.com/data/forums/attachment/forum/202112/06/145653bdx7zk7m0zfdjibd.png",[],{"type":24,"value":620},"，输入的m个训练样本",{"type":18,"tag":47,"props":622,"children":624},{"alt":7,"src":623},"https://bbs-img.huaweicloud.com/data/forums/attachment/forum/202112/06/145705nk3yrdsdmi9fxvzz.png",[],{"type":18,"tag":26,"props":626,"children":627},{},[628,630,634,636],{"type":24,"value":629},"输出：各隐藏层与输出层的线性关系系数矩阵",{"type":18,"tag":47,"props":631,"children":633},{"alt":7,"src":632},"https://bbs-img.huaweicloud.com/data/forums/attachment/forum/202112/06/1457421pj7gop4fl1uszqs.png",[],{"type":24,"value":635},"和偏倚向量",{"type":18,"tag":47,"props":637,"children":639},{"alt":7,"src":638},"https://bbs-img.huaweicloud.com/data/forums/attachment/forum/202112/06/145752gr5l64rvbqqdfr69.png",[],{"type":18,"tag":26,"props":641,"children":642},{},[643,645,648,649,652],{"type":24,"value":644},"1.初始化各隐藏层与输出层的线性关系系数矩阵",{"type":18,"tag":47,"props":646,"children":647},{"alt":7,"src":632},[],{"type":24,"value":635},{"type":18,"tag":47,"props":650,"children":651},{"alt":7,"src":638},[],{"type":24,"value":653},"的值为一个随机值。",{"type":18,"tag":26,"props":655,"children":656},{},[657],{"type":24,"value":658},"2.for iter to 1 to MAX：",{"type":18,"tag":660,"props":661,"children":662},"ol",{},[663],{"type":18,"tag":664,"props":665,"children":666},"li",{},[667],{"type":24,"value":668},"for i =1 to m：",{"type":18,"tag":26,"props":670,"children":671},{},[672,674,678,680],{"type":24,"value":673},"a) 将DNN输入",{"type":18,"tag":47,"props":675,"children":677},{"alt":7,"src":676},"https://bbs-img.huaweicloud.com/data/forums/attachment/forum/202112/06/145844efmaipyxfu32kjlu.png",[],{"type":24,"value":679},"设置为",{"type":18,"tag":47,"props":681,"children":683},{"alt":7,"src":682},"https://bbs-img.huaweicloud.com/data/forums/attachment/forum/202112/06/1458579idq0u0jevcwsu8w.png",[],{"type":18,"tag":26,"props":685,"children":686},{},[687,689,693,695],{"type":24,"value":688},"b) for",{"type":18,"tag":47,"props":690,"children":692},{"alt":7,"src":691},"https://bbs-img.huaweicloud.com/data/forums/attachment/forum/202112/06/145925hdurm1klslqohdu7.png",[],{"type":24,"value":694},"=2 to L，进行前向传播算法计算",{"type":18,"tag":47,"props":696,"children":698},{"alt":7,"src":697},"https://bbs-img.huaweicloud.com/data/forums/attachment/forum/202112/06/145938dcwjrvmpwxtjwnlj.png",[],{"type":18,"tag":26,"props":700,"children":701},{},[702,704],{"type":24,"value":703},"c) 通过损失函数计算输出层的",{"type":18,"tag":47,"props":705,"children":707},{"alt":7,"src":706},"https://bbs-img.huaweicloud.com/data/forums/attachment/forum/202112/06/145953bmojj63og5d7wqud.png",[],{"type":18,"tag":26,"props":709,"children":710},{},[711,713,717,719],{"type":24,"value":712},"d) for",{"type":18,"tag":47,"props":714,"children":716},{"alt":7,"src":715},"https://bbs-img.huaweicloud.com/data/forums/attachment/forum/202112/06/150033vyrlirta2tdspd6r.png",[],{"type":24,"value":718}," = L-1 to 2, 进行反向传播算法计算",{"type":18,"tag":47,"props":720,"children":722},{"alt":7,"src":721},"https://bbs-img.huaweicloud.com/data/forums/attachment/forum/202112/06/150057euvidkob9cu4pyua.png",[],{"type":18,"tag":660,"props":724,"children":726},{"start":725},2,[727],{"type":18,"tag":664,"props":728,"children":729},{},[730,732,736,738,741,742,746],{"type":24,"value":731},"for ",{"type":18,"tag":47,"props":733,"children":735},{"alt":7,"src":734},"https://bbs-img.huaweicloud.com/data/forums/attachment/forum/202112/06/1500212pcodkucsiuhfusl.png",[],{"type":24,"value":737},"= 2 to L，更新第",{"type":18,"tag":47,"props":739,"children":740},{"alt":7,"src":734},[],{"type":24,"value":430},{"type":18,"tag":47,"props":743,"children":745},{"alt":7,"src":744},"https://bbs-img.huaweicloud.com/data/forums/attachment/forum/202112/06/150156rlkrcjb3ss3viwdx.png",[],{"type":24,"value":747},":",{"type":18,"tag":26,"props":749,"children":750},{},[751],{"type":18,"tag":47,"props":752,"children":754},{"alt":7,"src":753},"https://bbs-img.huaweicloud.com/data/forums/attachment/forum/202112/06/150210ye0e7jlrmzwawoma.png",[],{"type":18,"tag":660,"props":756,"children":758},{"start":757},3,[759],{"type":18,"tag":664,"props":760,"children":761},{},[762,764,768],{"type":24,"value":763},"如果所有W，b的变化值都小于停止迭代阈值",{"type":18,"tag":47,"props":765,"children":767},{"alt":7,"src":766},"https://bbs-img.huaweicloud.com/data/forums/attachment/forum/202112/06/150303zafa2cmzlccivdwc.png",[],{"type":24,"value":769},"，则跳出迭代循环到步骤3。",{"type":18,"tag":26,"props":771,"children":772},{},[773],{"type":24,"value":774},"输出各隐藏层与输出层的线性关系系数矩阵W和偏倚向量b。",{"type":18,"tag":26,"props":776,"children":777},{},[778],{"type":24,"value":779},"好啦，今天小Mi的讲解就到这里啦，主要介绍了深度神经网络的前向传播和反向传播，还是稍微有点难度的，不过没难度咱们如何提高呢？下期给大家介绍深度神经网络的正则化！我们下期再见呦~",{"title":7,"searchDepth":781,"depth":781,"links":782},4,[783,784,785,786,787,788],{"id":34,"depth":725,"text":34},{"id":91,"depth":725,"text":97},{"id":117,"depth":725,"text":117},{"id":214,"depth":725,"text":214},{"id":273,"depth":725,"text":273},{"id":593,"depth":725,"text":593},"markdown","content:technology-blogs:zh:817.md","content","technology-blogs/zh/817.md","technology-blogs/zh/817","md",1776506141620]