Download presentation
Presentation is loading. Please wait.
Published byMilo Wilcox Modified over 9 years ago
1
.......... Artificial Neural Networks Shreekanth Mandayam Robi Polikar.......... …… …... … net k
2
..........
3
.......... Function Approximation Constructing complicated functions from simple building blocks Lego systems Fourier / wavelet transforms VLSI systems RBF networks
4
.......... Function Approximation * * * * * * * * * * ?
5
.......... Function Approx. Vs. Classification Classification can be thought of as a special case of function approximation: For a three class problem: Classifier …. x Class 1: [1 0 0] Class 2: [0 1 0] Class 3: [0 0 1] Classifier …. x 1: Class 1 2: Class 2 3: Class 3 x1x1 xdxd x1x1 xdxd d-dimensional input x 1 or 3, c-dimensional input y y=f(x)
6
.......... Radial Basis Function Neural Networks The RBF networks, just like MLP networks, can therefore be used classification and/or function approximation problems. The RBFs, which have a similar architecture to that of MLPs, however, achieve this goal using a different strategy: ……….. Input layer Nonlinear transformation layer (generates local receptive fields) Linear output layer
7
.......... Nonlinear Receptive Fields The hallmark of RBF networks is their use of nonlinear receptive fields RBFs are universal approximators ! The receptive fields nonlinearly transforms (maps) the input feature space, where the input patterns are not linearly separable, to the hidden unit space, where the mapped inputs may be linearly separable. The hidden unit space often needs to be of a higher dimensionality Cover’s Theorem (1965) on the separability of patterns: A complex pattern classification problem that is nonlinearly separable in a low dimensional space, is more likely to be linearly separable in a high dimensional space.
8
.......... The (you guessed it right) XOR Problem 0 1 0 1 Consider the nonlinear functions to map the input vector x to the 1 - 2 space x1x1 x2x2 x=[x 1 x 2 ] Input x 1 (x) 2 (x) (1,1)10.1353 (0,1)0.3678 (1,0)0.3678 (0,0)0.13531 0 0.2 0.4 0.6 0.8 1.0 1.2 | | | | | | ____________ 1.0 0.8 0.6 0.4 0.2 0 (0,0) (1,1) (0,1) (1,0) The nonlinear function transformed a nonlinearly separable problem into a linearly separable one !!!
9
.......... Initial Assessment Using nonlinear functions, we can convert a nonlinearly separable problem into a linearly separable one. From a function approximation perspective, this is equivalent to implementing a complex function (corresponding to the nonlinearly separable decision boundary) using simple functions (corresponding to the linearly separable decision boundary) Implementing this procedure using a network architecture, yields the RBF networks, if the nonlinear mapping functions are radial basis functions. Radial Basis Functions: Radial: Symmetric around its center Basis Functions: A set of functions whose linear combination can generate an arbitrary function in a given function space.
10
.......... RBF Networks …….... ……... U ji W kj xdxd x (d-1) x2x2 x1x1 d input nodes H hidden layer RBFs (receptive fields) c output nodes zczc z1z1.. … zkzk net k yjyj 11 HH jj x1x1 xdxd u Ji : spread constant Linear act. function
11
.......... Principle of Operation x1x1 xdxd U Ji : spread constant y1y1 w Kj yJyJ yHyH Unknowns: u ji, w kj, Euclidean Norm
12
.......... Principle of Operation What do these parameters represent? Physical meanings: : The radial basis function for the hidden layer. This is a simple nonlinear mapping function (typically Gaussian) that transforms the d- dimensional input patterns to a (typically higher) H-dimensional space. The complex decision boundary will be constructed from linear combinations (weighted sums) of these simple building blocks. u ji : The weights joining the first to hidden layer. These weights constitute the center points of the radial basis functions. : The spread constant(s). These values determine the spread (extend) of each radial basis function. W jk : The weights joining hidden and output layers. These are the weights which are used in obtaining the linear combination of the radial basis functions. They determine the relative amplitudes of the RBFs when they are combined to form the complex function.
13
.......... RBFN Principle of Operation J : J th RBF function * u J Center of J th RBF JJ w J :Relative weight of J th RBF
14
.......... How to Train? There are various approaches for training RBF networks. Approach 1: Exact RBF – Guarantees correct classification of all training data instances. Requires N hidden layer nodes, one for each training instance. No iterative training is involved. RBF centers (u) are fixed as training data points, spread as variance of the data, and w are obtained by solving a set of linear equations Approach 2: Fixed centers selected at random. Uses H<N hidden layer nodes. No iterative training is involved. Spread is based on Euclidean metrics, w are obtained by solving a set of linear equations. Approach 3: Centers are obtained from unsupervised learning (clustering). Spreads are obtained as variances of clusters, w are obtained through LMS algorithm. Clustering (k-means) and LMS are iterative. This is the most commonly used procedure. Typically provides good results. Approach 4: All unknowns are obtained from supervised learning.
15
.......... Approach 1 Exact RBF The first layer weights u are set to the training data; U=X T. That is the gaussians are centered at the training data instances. The spread is chosen as, where d max is the maximum Euclidean distance between any two centers, and N is the number of training data points. Note that H=N, for this case. The output of the k th RBF output neuron is then During training, we want the outputs to be equal to our desired targets. Without loss of any generality, assume that we are approximating a single dimensional function, and let the unknown true function be f(x). The desired output for each input is then d i =f(x i ), i=1, 2, …, N. Single output (Not to be confused with input dimensionality d) Multiple outputs (wj)(wj)
16
.......... Approach 1 (Cont.) We then have a set of linear equations, which can be represented in the matrix form: Define: Is this matrix always invertible? y
17
.......... Approach 1 (Cont.) Michelli’s Theorem (1986) If {x i } i N =1 are a distinct set of points in the d-dimensional space, then the N by N interpolation matrix with elements obtained from radial basis functions is nonsingular, and hence can be inverted! Note that the theorem is valid regardless the value of N, the choice of the RBF (as long as it is an RBF), or what the data points may be, as long as they are distinct! A large number of RBFs can be used: Multiquadrics: Inverse multiquadrics: Gaussian functions:
18
.......... Approach1 (Cont.) The Gaussian is the most commonly used RBF (why…?). Note that Gaussian RBFs are localized functions ! unlike the sigmoids used by MLPs Using Gaussian radial basis functions Using sigmoidal radial basis functions
19
.......... Exact RBF Properties Using localized functions typically makes RBF networks more suitable for function approximation problems. Why? Since first layer weights are set to input patterns, second layer weights are obtained from solving linear equations, and spread is computed from the data, no iterative training is involved !!! Guaranteed to correctly classify all training data points! However, since we are using as many receptive fields as the number of data, the solution is over determined, if the underlying physical process does not have as many degrees of freedom Overfitting! The importance of : Too small will also cause overfitting. Too large will fail to characterize rapid changes in the signal.
20
.......... Too many Receptive Fields? In order to reduce the artificial complexity of the RBF, we need to use fewer number of receptive fields. How about using a subset of training data, say M < N of them. These M data points will then constitute M receptive field centers. How to choose these M points…? At random Approach 2. Unsupervised training: K-means Approach 3 The centers are selected through self organization of clusters, where the data is more densely populated. Determining M is usually heuristic. Output layer weights are determined as they were in Approach 1, through solving a set of M linear equations!
21
.......... K-Means - Unsupervised Clustering - Algorithm Choose number of clusters, M Initialize M cluster centers to the first M training data points: t k =x k, k=1,2,…,M. Repeat At iteration n, group all patterns to the cluster whose center is closest Compute the centers of all clusters after the regrouping Until there is no change in cluster centers from one iteration to the next. t k (n): center of k th RBF at n th iteration New cluster center for k th RBF. Number of instances in the k th cluster Instances that are grouped in the k th cluster An alternate k-means algorithm is given in Haykin (p. 301). Approach 3
22
.......... Determining the Output Weights: LMS Algorithm The LMS algorithm is used to minimize the cost function where e(n) is the error at iteration n: Using the steepest (gradient) descent method: Instance based LMS algorithm pseudocode (for single output): Initialize weights, w j to some small random value, j=1,2,…,M Repeat Choose next training pair (x, d); Compute network output at iteration n: Compute error: Update weights: Until weights converge to a steady set of values Approach 3
23
.......... Supervised RBF Training This is the most general form. All parameters, receptive field centers (first layer weights), output layer weights and spread constants, are learned through iterative supervised training using LMS / gradient descent algorithm. Approach 4: E G’ represents the first derivative of the function wrt its argument
24
.......... RBF Matlab Demo
25
.......... RBF Lab Due: Friday, March 15 1.Implement the Exact RBF approach in MATLAB (writing your own code) on a simple one-dimensional function approximation problem, as well as a classification problem. Generate your own function approx. example, and use the IRIS database for classification (from UCI – ML database). Compare your results to that of MATLAB’s built-in function 2.Implement Approach 2, using the code you generated for Q1. 3.Implement Approach 3. Write your own K-means and LMS codes. Compare your results to that of MATLAB’s newrb() function, both for function approximation and classification problems. 4.Apply your algorithms to the Dominant VOC gas sensing database (available in \\galaxy\public1\polikar\PR_Clinic\Databases for PR Class.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.