转至: http://www.matlabsky.com/thread-4084-1-1.html |
【转】 Matlab神经网络工具箱中的Train和Adapt函数区别
先看看Matlab官方的解释,请如下操作: 在Matlab的Command Window中输入doc adapt或者doc train,将滚动条拖到最后有一个Algorithm说明,这里有两个函数的计算介绍。 adapt train 我们再看一个Matlab帮助系统自带的解释 matlab中神经网络的训练分为批训练(batch training)和增长训练(incremental training)。 其中如果用train来训练网络则是批训练,而adapt既可以实现批训练,也可以实现增长训练,主要取决于神经网络的输入形式是并行输入(concurrent inputs)还是串行输入(sequential inputs),如果是前者则实现批训练,如果后者则是增长训练。 所谓批训练是指当全部输入都输入神经网络后,其权值和阀值才更新一次。而增长训练是指每输入一个输入,权值和阀值就更新一次。 所谓并行输入,其格式是用数组[]的形式来表示。即[1 2,3 4]这个就是并行输入,其输入不分先后。而串行输入则是用细胞数组{}来表示,如{[1;3],[2;4]},其输入有先后顺序 换句话说,到底是串行还是并行,不是通过神经网络的某个参数来决定的,而是看输入样本的格式(“[]”还是“{}”)。 但是对于train()而言,即使你的输入是串行输入,它也许自动把该输入转化为并行输入进行批训练。简单而言,train只能用于批训练。而adapt两者都可以(批训练或者增长训练),如何进行就看输入形式。不是通过参数来规定串行还是并行,而是通过输入的形式是同时输入还是顺序输入来决定的。但是对于train方法而言,即使你的输入是顺序输入,它也许自动把该输入转化为同时输入进行批训练。简单而言,train只能用于批训练。 比如说,训练样本有100个 1.train:在这100个样本一次性掉入进行网络计算后,对网络参数进行一次调整。 2.adapt:如果[]输入,这和train相当;如果{}输入,则样本一个一个输入,每输入一个样本数据进行一次计算,然后对网络参数进行一次调整,所以共要调整100次。 需要注意的一点是,不是所有的训练函数和学习函数都支持增长训练(incremental training) 最后再看一个官方说明 |