Recurrent Neural Networks for Prediction
Authored by Danilo P. Mandic, Jonathon A. Chambers
Copyright c
2001 John Wiley & Sons Ltd
ISBNs: 0-471-49517-4 (Hardback); 0-470-84535-X (Electronic)
9
A Class of Normalised
Algorithms for Online Training
of Recurrent Neural Networks
9.1 Perspective
A normalised version of the real-time recurrent learning (RTRL) algorithm is intro-
duced. This has been achieved via local linearisation of the RTRL around the current
point in the state space of the network. Such an algorithm provides an adaptive learn-
ing rate normalised by the L2norm of the gradient vector at the output neuron. The
analysis is general and also covers simpler cases of feedforward networks and linear
FIR filters.
9.2 Introduction
Gradient-descent-based algorithms for training neural networks, such as the back-
propagation, backpropagation through time, recurrent backpropagation (RBP) and
real-time recurrent learning (RTRL) algorithm, typically suffer from slow convergence
when dealing with statistically nonstationary inputs. In the area of linear adaptive
filters, similar problems with the LMS algorithm have been addressed by utilising
normalised algorithms, such as NLMS. We therefore introduce a normalised RTRL-
based learning algorithm with the idea to impose similar stabilisation and convergence
effects on training of RNNs, as normalisation imposes on the LMS algorithm.
In the area of linear FIR adaptive filters, it is shown (Soria-Olivas et al. 1998) that
a normalised gradient-descent-based learning algorithm can be derived starting from
the Taylor series expansion of the instantaneous output error of an adaptive FIR filter,
given by
e(k+1)=e(k)+
N
i=1
∂e(k)
∂wi(k)∆wi(k)+ 1
2!
N
i=1
N
j=1
∂2e(k)
∂wi(k)∂wj(k)∆wi(k)∆wj(k)+··· .
(9.1)
150 OVERVIEW
From the mathematical description of LMS1from Chapter 2, we have
∂e(k)
∂wi(k)=−x(k−i+1),i=1,2,...,N, (9.2)
and
∆wi(k)=µ(k)e(k)x(k−i+1),i=1,2,...,N. (9.3)
Due to the linearity of the FIR filter, the second- and higher-order partial derivatives
in (9.1) vanish.
Combining (9.1)–(9.3) yields
e(k+1)=e(k)−µ(k)e(k)x(k)2
2(9.4)
for which the nontrivial solution gives the learning rate of a normalised LMS algorithm
µNLMS(k)= 1
x(k)2
2
.(9.5)
The stability analysis of adaptive algorithms can be undertaken using contractive
operators and fixed point iteration. For the contractive operator T, it follows that
Tz
1−Tz
2γz1−z2,0γ<1,z1,z2∈RN.(9.6)
The convergence analysis of LMS, for instance, can be undertaken starting from the
misalignment2vector v(k)=w(k)−˜
w(k) by setting z1=v(k+ 1), z2=v(0)
and T=[I−µ(k)x(k)xT(k)] (Gholkar 1990). Detailed convergence analysis for a
class of gradient-based learning algorithms for recurrent neural networks is given in
Chapter 10.
9.3 Overview
A class of normalised gradient-based algorithms is derived starting from the LMS
algorithm for linear adaptive filters through to a normalised algorithm for training
recurrent neural networks. For each case the adaptive learning rate has been derived.
Stability of such algorithms is addressed in Chapter 10. The normalised algorithms
are shown to outperform standard algorithms with fixed learning rate.
1The two core equations for adaptation of the LMS algorithm are
e(k)=d(k)−xT(k)w(k),
w(k+1)=w(k)+µ(k)e(k)x(k).
2The misalignment vector is defined as v(k)=w(k)−˜
w(k), where ˜
w(k) is the set of optimal
weights of the system.
A CLASS OF NORMALISED ALGORITHMS FOR TRAINING OF RNNs 151
100 200 300 400 500 600 700 800 900 1000
−30
−25
−20
−15
−10
−5
0
Number of iteration
Averaged squared prediction error in dB
NGD
LMS
NLMS
NNGD
Figure 9.1 Comparison of convergence of the averaged squared prediction error with the
LMS, NLMS, NGD and NNGD algorithms, with logistic activation function, for a coloured
input
9.4 Derivation of the Normalised Adaptive Learning Rate for a Simple
Feedforward Nonlinear Filter
The equations that define the adaptation for a neural adaptive filter with one neuron
(Figure 2.6), trained by a nonlinear gradient descent (NGD) algorithm, are
e(k)=d(k)−Φ(xT(k)w(k)),(9.7)
w(k+1)=w(k)+η(k)Φ′(xT(k)w(k))e(k)x(k),(9.8)
where e(k) is the instantaneous error at the output neuron, d(k) is some train-
ing (desired) signal, x(k)=[x1(k),...,x
N(k)]Tis the input vector, w(k)=
[w1(k),...,w
N(k)]Tis the weight vector, Φ(·) is a nonlinear activation function of
a neuron and ( ·)Tdenotes the vector transpose. The learning rate ηis supposed to
be a small positive real number. Following the approach from Mandic (2000a), if the
output error (9.7) is expanded using a Taylor series expansion, we have
e(k+1)=e(k)+
N
i=1
∂e(k)
∂wi(k)∆wi(k)+ 1
2!
N
i=1
N
j=1
∂2e(k)
∂wi(k)∂wj(k)∆wi(k)∆wj(k)+··· .
(9.9)
From (9.7) and (9.8), the elements of (9.9) are
∂e(k)
∂wi(k)=−Φ′(xT(k)w(k))xi(k),i=1,2,...,N, (9.10)
152 DERIVATION OF THE NORMALISED ALGORITHM
0 100 200 300 400 500 600 700 800 900 1000
−30
−25
−20
−15
−10
−5
NNGD
NLMS
LMS
Number of iteration
Averaged squared prediction error in dB
Figure 9.2 Comparison of convergence of the averaged squared prediction error of the
LMS, NLMS and NNGD algorithms for a coloured input and tanh activation function with
β=1
and
∆wi(k)=wi(k+1)−wi(k)=η(k)Φ′(xT(k)w(k))e(k)xi(k),i=1,2,...,N.
(9.11)
The second partial derivatives are
∂2e(k)
∂wi(k)∂wj(k)=−Φ′′ (xT(k)w(k))xi(k)xj(k),i,j=1,2,...,N. (9.12)
Let us denote net(k)=xT(k)w(k). Combining (9.9)–(9.12) yields
e(k+1)=e(k)−η(k)[Φ′(net(k))]2e(k)
N
i=1
x2
i(k)
−1
2!η2(k)e2(k)[Φ′(net(k))]2Φ′′ (net(k))
N
i=1
N
j=1
x2
i(k)x2
j(k)+··· .(9.13)
A truncated Taylor series expansion of (9.13) gives
e(k+1)=e(k)[1 −η(k)[Φ′(net(k))]2x(k)2
2].(9.14)
A CLASS OF NORMALISED ALGORITHMS FOR TRAINING OF RNNs 153
0 500 1000 1500 2000 2500 3000
−24
−22
−20
−18
−16
−14
−12
−10
−8
−6
−4
Number of iteration
Averaged squared prediction error in dB
IIR LMS
LMS
Rec Per
NNGD
NLMS
Figure 9.3 Convergence comparison of averaged squared prediction error for feedforward
and recurrent structures, tanh activation function with β= 4 and coloured input
The aim is for the error e(k+1) in (9.14) to vanish, which is the case for the nontrivial
solution
ηOPT(k)= 1
[Φ′(net(k))]2x(k)2
2
,(9.15)
which is the step size of a normalised gradient descent (NNGD) algorithm for a non-
linear FIR filter. Taking into account the bounds3on the values of higher derivatives
of Φ, for a contractive activation function we may adjust the derived learning rate
with a positive constant C,as
ηOPT(k)= 1
C+[Φ′(net(k))]2x(k)2
2
.(9.16)
The magnitude of the learning rate varies in time with the tap input power and
the first derivative of the activation function, which provides a normalisation of the
algorithm. Further discussion on the size and role of constant Cin (9.16) can be
found in Mandic and Krcmar (2001) and Krcmar and Mandic (2001). The adaptive
learning rate from (9.15) degenerates into the learning rate of the NLMS algorithm
for a linear activation function. A normalised backpropagation algorithm for a general
feedforward neural network is given in Mandic and Chambers (2000f). Although the
3For the logistic function, for instance, the second-order term in the Taylor series expansion is
positive.