李宏毅老师课程:Backpropagation(反向传播)

李宏毅机器学习课程7~~~反向传播 到底为什么基于反向传播的纯监督学习在过去表现不佳?Geoffrey Hinton总结了目前发现的四个方面问题:带标签的数据集很小,只有现在的千分之一. 计算性能很慢,只有现在的百万分之一. 权重的初始化方式笨拙. 使用了错误的非线性模型。 深度学习=许多训练数据+并行计算+规模化、灵巧的的算法链式法则反向传播直接套用链式法则先计算链式法则里面的第一项计算链式法则第二项,第二项继续使用链式法则链式法则 阅读详情

用来告诉我们用gradient descent来train一个neural network的时候该怎么做

Chain Rule(链式法则)

对整个neural network,我们定义了一个loss function:L(θ),它等于所有training data的loss之和
在这里插入图片描述
我们把training data里任意一个样本点xn代到neural network里面,它会output一个yn,我们把这个output跟样本点本身的label标注的target作cross entropy,这个交叉熵定义了output和target之间的距离ln(θ),如果cross entropy比较大的话,说明output和target之间距离很远,这个network的parameter的loss是比较大的,反之则说明这组parameter是比较好的

然后对所有training data的cross entropy求和,得到L(θ),这就是我们的loss function,用这个对某一个参数w做偏微分,表达式如下:
在这里插入图片描述
在这里插入图片描述

Forward pass

在这里插入图片描述

李宏毅机器学习笔记-7 反向传播算法(Backpropagation) Backpropagation-反向传播算法 1 前言 1.1 为什么要用 Backpropagation 在神经网络中的梯度下降算法和之前求线性回归方程中用的没有太大的区别,都是不断的计算微分,然后更新参数,最终找到一个最优解。 但是在神经网络中,有着大量可能多达上百万个的参数,所以传统的求微分方法行不通,计算量太大无法快速有效的求出微分。 1.2 链式求导法则(Chai... 阅读详情

相关推荐

反向传播法(backpropagation)的基本原理

本文通过整理李宏毅老师的机器学习教程的内容,介绍神经网络中用于更新参数的反向传播法(backpropagation)的基本原理。

星海浮生 605

神经网络从零实现:前向传播与反向传播原理详解

神经网络作为机器学习中的核心模型,其本质是通过多层非线性变换来拟合复杂的数据模式。其基本原理基于神经元、权重矩阵和激活函数的组合,通过前向传播完成数据从输入到输出的映射,再通过反向传播和梯度下降算法优化网络参数。这一技术价值在于能够自动学习数据中的高阶特征,广泛应用于图像识别、自然语言处理和时间序列预测等领域。本文以全连接神经网络为例,深入解析其前向传播与反向传播机制,并通过手写数字识别案例,展示如何从零实现一个可运行的神经网络模型,帮助读者理解梯度下降和参数更新的具体过程。

weixin_33895695的博客 364

junyi PSLC 数据集处理 —— txt 转 csv

网上的代码 import numpy as np import pandas as pd txt = np.loadtxt('junyi_ProblemLog_for_PSLC.txt') txtDF = pd.DataFrame(txt) txtDF.to_csv('junyi_ProblemLog_for_PSLC.csv',index=False) 实测不行 改进的代码 import numpy as np import pandas as pd txt = np.genfromtxt('ju

APythonC的博客 1068

【李宏毅机器学习笔记】7、反向传播(Backpropagation)

【李宏毅机器学习笔记】1、回归问题(Regression) 【李宏毅机器学习笔记】2、error产生自哪里? 【李宏毅机器学习笔记】3、gradient descent 【李宏毅机器学习笔记】4、Classification 【李宏毅机器学习笔记】5、Logistic Regression 【李宏毅机器学习笔记】6、简短介绍Deep Learning 【李宏毅机器学习笔记】7、反向传播(Backpropagation) 【李宏毅机器学习笔记】8、Tips for Training DNN 【李宏毅机器学习笔记】9、Convolutional Neural Network(CNN) ——————

On the convergence of FedAvg on non-iid data

On the convergence of FedAvg on non-iid data

Lyn_S的博客 7082

LTSPICE仿真电路:(二十八)三极管厄利电压与输出特性曲线深度解析

本文深入解析了LTSPICE仿真电路中三极管的厄利电压与输出特性曲线,详细介绍了厄利电压的物理意义、仿真设置及实际应用。通过伏安特性曲线和厄利电压的分析,帮助读者理解三极管放大性能的关键参数,并提供了电路设计中的优化方案和故障排查技巧。

weixin_26899659的博客 149

Android-S无线模块前瞻

WiFi - mainlane非强制 S 采用反射的方法直接加载wifiservice,直接hook在systemserver上,无编译依赖。gms可以动态替换wifi服务。 R 采用直接启动service的方式,wifiservice仍然map在systemserver上。 WiFi - 11ad接口支持 11ad被wifi联盟商业化为WIGIG,提供短距的60GHZ载波,理论速度为当前5G 11ac的6倍。市面上基本没有手机支持,需要独立的芯片支撑此功能。 传输距离为3m以内,外界d.

头铁的伦的博客 1044

27、目标识别的最新进展

本文综述了目标识别(OID)领域的最新进展,重点介绍了质量评估、预处理和搜索空间缩减等关键技术。文章分析了多种质量指标,如缩减率、对完整性、召回率和精确率等,并探讨了它们的适用场景。同时,详细介绍了预处理中自动学习转换规则的方法,以及传统阻塞、排序邻域索引等搜索空间缩减技术。此外,文章还讨论了动态选择缩减技术的方法,并展望了未来研究方向,如更智能的预处理、自适应的缩减技术和与人工智能的结合。希望这些技术和方法能够为目标识别领域的研究和实践提供参考和帮助。

q5r6s7的博客 93

Loop Engineering 来了:从写 Prompt 到设计 Loop,AI 编程的第四次范式跃迁

文章摘要: Loop Engineering是AI编程领域的新范式,标志着从"人手动喂指令"到"设计自驱动循环"的跃迁。其核心在于通过五个组件(定时器、工作空间、知识体系、连接器和子Agent验证)构建自动化任务流,使AI系统能自主运行。这一概念的火爆源于模型能力和工具链的成熟,使得任务设计成为关键瓶颈。作者指出,从Prompt到Loop的四次范式跃迁(语言学→信息科学→控制论→管理学)反映了人机协作关系的根本变化:人类角色从执行者逐渐退居为目标设定者。落地Loop Engineering的真正挑战在于目标

少说,多做 332

图神经网络实战(5)——常用图数据集

Cora 和 Facebook Page-Page 是图神经网络领域中经常使用的两个基准图数据集,通常用来比较不同模型的性能。在本节中,介绍了如何使用 PyTorch Geometric 库提供的数据集类加载 Cora 和 Facebook Page-Page 数据集,并探索了两个数据集的主要特征。

盼小辉丶的博客 1万+

2021年03月 C/C++(五级)真题解析#中国电子学会#全国青少年软件编程等级考试

给定一个十进制正整数n(0 < n < 1000000000),每个数位上数字均不为0。n的位数为m。现在从m位中删除k位(0

人生就是一个不断学习的过程 1012

openlayers全面教程306+【目录】

vue+openlayers系列教程旨在为开发者提供简单快捷的示例。在每一个示例中,解释相应的API知识点。

大剑师兰特的GIS世界 2万+

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

IDEA的使用指南

IDEA基于java的使用手册,可以最快速的上手,在使用中不断的丰富自己的使用技巧.

IEM模型,地表粗糙度模拟

利用微波反演土壤水分时候,利用IEM模型可以实现对随机地表的模拟

上一篇: 李宏毅老师课程:Convolutional Neural Network
下一篇: 李宏毅老师课程:Tips for Deep Learning
APythonC
博客等级 码龄7年 23粉丝 58原创
评论 3
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值