[{"data":1,"prerenderedAt":102},["ShallowReactive",2],{"article-other\u002Ffun_to_neural_network":3},{"_path":4,"_dir":5,"_draft":6,"_partial":6,"_locale":7,"title":8,"description":9,"date":10,"tags":11,"body":13,"_type":96,"_id":97,"_source":98,"_file":99,"_stem":100,"_extension":101},"\u002Farticles\u002Fother\u002Ffun_to_neural_network","other",false,"","从函数到神经网络：参数学习、梯度下降与反向传播","从线性函数 y = wx + b 出发，理解激活函数、损失函数、梯度下降和反向传播如何共同训练神经网络，并认识过拟合与泛化能力。","2026-09-07",[12],"随笔",{"type":14,"children":15,"toc":90},"root",[16,24,30,35,40,45,50,55,60,65,70,75,80,85],{"type":17,"tag":18,"props":19,"children":21},"element","h2",{"id":20},"从函数到神经网络",[22],{"type":23,"value":20},"text",{"type":17,"tag":25,"props":26,"children":27},"p",{},[28],{"type":23,"value":29},"从符号主义(我要找到宇宙真理的万能公式)到联结主义(找一个近似解猜一下)。",{"type":17,"tag":25,"props":31,"children":32},{},[33],{"type":23,"value":34},"神经网络，本质上就是 y = f(x) = wx + b，一直x和y去猜w和b，很多时候，光是wx + b无法得出想要的结果，就要在wx + b外再套一层函数，这层函数就是激活函数。",{"type":17,"tag":25,"props":36,"children":37},{},[38],{"type":23,"value":39},"神经网络包含：输入层、隐藏层、输出层",{"type":17,"tag":25,"props":41,"children":42},{},[43],{"type":23,"value":44},"![image-20260827155628345](\u002FUsers\u002Fo_insist\u002FLibrary\u002FApplication Support\u002Ftypora-user-images\u002Fimage-20260827155628345.png)",{"type":17,"tag":18,"props":46,"children":48},{"id":47},"计算神经网络的参数",[49],{"type":23,"value":47},{"type":17,"tag":25,"props":51,"children":52},{},[53],{"type":23,"value":54},"损失函数：真实值与预测值的误差，我们要将损失函数降到最低",{"type":17,"tag":25,"props":56,"children":57},{},[58],{"type":23,"value":59},"均方误差是用来表示损失函数的一种",{"type":17,"tag":25,"props":61,"children":62},{},[63],{"type":23,"value":64},"损失函数最小时算出的w和b，y = wx + b就是最拟合真实数据的那条直线",{"type":17,"tag":25,"props":66,"children":67},{},[68],{"type":23,"value":69},"梯度下降：让损失函数逐渐减小的过程",{"type":17,"tag":25,"props":71,"children":72},{},[73],{"type":23,"value":74},"总结：为了找到一组w和b来拟合真实数据，我们定义损失函数，并且，通过制定让损失函数最小化的这个目标，来计算w和b，接下来我们通过简单的线性回归问题，发现可以让损失函数的导数等于零，一步就求到w和b，但是 神经网络的复杂性，没有办法照顾忽而得到w和b的解析解，只能通过一点点往偏导数的反方向调整每个参数，来慢慢逼近真实答案，这个方法就叫做梯度下降，由于神经网络的层数较多，直接求偏导非常困难，因此可以逐层求导，间接得到最终的偏导数，通过链式法则求导，并逐层更新参数这个过程就是反向传播、不断的前向传播，反向传播，就构成了神经网络的训练过程。",{"type":17,"tag":18,"props":76,"children":78},{"id":77},"调教神经网络的方法",[79],{"type":23,"value":77},{"type":17,"tag":25,"props":81,"children":82},{},[83],{"type":23,"value":84},"过拟合：在训练集上表现很好，但是在未见过的数据上表现很差。",{"type":17,"tag":25,"props":86,"children":87},{},[88],{"type":23,"value":89},"泛化能力：在没见过的数据上的表现能力。",{"title":7,"searchDepth":91,"depth":91,"links":92},2,[93,94,95],{"id":20,"depth":91,"text":20},{"id":47,"depth":91,"text":47},{"id":77,"depth":91,"text":77},"markdown","content:articles:other:fun_to_neural_network.md","content","articles\u002Fother\u002Ffun_to_neural_network.md","articles\u002Fother\u002Ffun_to_neural_network","md",1789465114556]