Matlab神经网络十讲(7): Adaptive Filter and Adaptive Training
1. Adaptive Function?
? ? ? ? The function adapt can change the weight and bias of a network incrementally during training.
A linear neuron with R inputs is shown left.
R是輸入向量的個(gè)數(shù)。
This network has the same basic structure as the perceptron. The only difference is that the linear neuron uses a linear transfer function, named purelin.
The linear transfer function calculates the neuron's output by simply returning the value passed to it.
α = purelin(n) = purelin(Wp + b) = Wp + b
2.?Adaptive Linear Network Architecture
R:輸入向量的個(gè)數(shù)
S:神經(jīng)元的個(gè)數(shù)
The Widrow-Hoff (MSE) rule can only train single-layer linear networks. This is not much of a disadvantage, however, as single-layer linear networks are just as capable as multilayer linear networks. For every multilayer linear network, there is an equivalent single-layer linear network.(每一額多層線性神經(jīng)網(wǎng)絡(luò)可以等效為單層網(wǎng)絡(luò))
2.1 Single AdaLine
Consider a single ADALINE with two inputs. The following figure shows the diagram for this network.
The weight matrix W in this case has only one row. The network output is
α = purelin(n) = purelin(Wp + b) = Wp + b
? ? ? ? We can create a network similar to the one shown using this command:
? ? ? ?The network weights and biases are set to zero, by default. We can see the current values using the commands:
net.IW{1,1} = [2 3]; net.b{1} = -4;
? ? ? ?We can simulate the ADALINE for a particular input vector.
p = [5; 6]; a = sim(net,p) >> a =24 ? ? ? To summarize, we can create an ADALINE network with linearlayer, adjust its? elements as we want, and simulate it with sim.2.2?Least Mean Square Error
? ? ??Like the perceptron learning rule, the least mean square error (LMS) algorithm is an example of supervised training, in which the learning rule is provided with a set of examples of desired network behavior.
{p1,t1 }, {p2,t2 },..., { pQ,tQ}.
? ? ? Here pq is an input to the network, and tq is the corresponding target output. As each input is applied to the network, the network output is compared to the target. The error is calculated as the difference between the target output and the network output. The goal is to minimize the average of the sum of these errors:
? ? ? ? The LMS algorithm adjusts the weights and biases of the ADALINE so as to minimize this mean square error.
? ? ? ??Fortunately, the mean square error performance index for the ADALINE network is a quadratic function. Thus, the performance index will either have one global minimum, a weak minimum, or no minimum, depending on the characteristics of the input vectors. Specifically, the characteristics of the input vectors determine whether or not a unique solution exists.
2.3?LMS Algorithm (learnwh)
? ?Adaptive networks will use the LMS algorithm or Widrow-Hoff learning algorithm based on an approximate steepest descent procedure. Here again, adaptive linear networks are trained on examples of correct behavior.
3.?Adaptive Filtering (adapt)
? ?The ADALINE network, much like the perceptron, can only solve linearly separable problems. It is, however, one of the most widely used neural networks found in practical applications. Adaptive filtering is one of its major application areas.
3.1 ?Tapped Delay Line(抽頭延遲)
We need a new component, the tapped delay line, to make full use of the ADALINE network. Such a delay line is shown in the figure. The input signal enters from the left and passes through N-1 delays. The output of the tapped delay line (TDL) is an Ndimensional vector, made up of the input signal at the current time, the previous input signal, etc.
We can combine a tapped delay line with an ADALINE network to create the adaptive filter shown in the figure.
The output of the filter is given:
3.2?Adaptive Filter Example
? ? ??First, define a new linear network using linearlayer
Assume that the linear layer has a single neuron with a single input and a tap delay of 0, 1, and 2 delays.
we can give the various weights and the bias values with
? ? ? Finally, define the initial values of the outputs of the delays as
pi = {1 2}; % 是指 p(t-1)和p(t-2) ? ? ? These are ordered from left to right to correspond to the delays taken from top to bottom in the figure. This concludes the setup of the network.? ? ? To set up the input, assume that the input scalars arrive in a sequence: first the value 3, then the value 4, next the value 5, and finally the value 6. we can indicate this sequence by defining the values as elements of a cell array in curly braces.
a = % 最終的輸出序列1×4 cell 數(shù)組{[46]} {[70]} {[94]} {[118]} pf = % 最終的延遲數(shù)值1×2 cell 數(shù)組{[5]} {[6]}
3.3?Prediction Example
? ? ??Suppose that we want to use an adaptive filter to predict the next value of a stationary random process, p(t). We can use the network shown in the following figure to do this prediction.
The signal to be predicted, p(t), enters from the left into a tapped delay line. The previous two values of p(t) are available as outputs from the tapped delay line. The network uses adapt to change the weights on each time step so as to minimize the error e(t) on the far right. If this error is 0, the network output a(t) is exactly equal to p(t), and the network has done its prediction properly.
3.4?Noise Cancelation Example
? ? ??Consider a pilot in an airplane. When the pilot speaks into a microphone, the engine noise in the cockpit combines with the voice signal. This additional noise makes the resultant signal heard by passengers of low quality. The goal is to obtain a signal that contains the pilot's voice, but not the engine noise. We can cancel the noise with an adaptive filter if we obtain a sample of the engine noise and apply it as the input to the adaptive filter.
4.?Multiple Neuron Adaptive Filters
? ??We might want to use more than one neuron in an adaptive system, so we need some additional notation. We can use a tapped delay line with S linear neurons, as shown in the bellow figure.
總結(jié)
以上是生活随笔為你收集整理的Matlab神经网络十讲(7): Adaptive Filter and Adaptive Training的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 结合PE格式对linker分析1
- 下一篇: MFC返回的临时对象指针成因?