Presentation is loading. Please wait.

Presentation is loading. Please wait.

ARTIFICIAL INTELLIGENCE

Similar presentations


Presentation on theme: "ARTIFICIAL INTELLIGENCE"— Presentation transcript:

1 ARTIFICIAL INTELLIGENCE
CS 621 Artificial Intelligence Lecture /10/05 Prof. Pushpak Bhattacharyya Perceptron Training & Convergence Prof. Pushpak Bhattacharyya, IIT Bombay

2 Perceptron Training Algo (PTA)
Preprocessing: 1. The computation law is modified to y = 1 if ∑wixi > θ y = 0 if ∑wixi < θ θ, ≤ w1 w2 wn x1 x2 x3 xn θ, < w1 w2 w3 wn x1 x2 x3 xn Prof. Pushpak Bhattacharyya, IIT Bombay

3 PTA – preprocessing (contd)
2. Absorb θ as a weight 3. Negate all the zero-class examples w1 w2 w3 wn x2 x3 xn x1 w0=θ x0= -1 θ w1 w2 w3 wn x2 x3 xn Prof. Pushpak Bhattacharyya, IIT Bombay

4 Example to Demonstrate Preprocessing
OR perceptron 1-class <1,1> , <1,0> , <0,1> 0-class <0,0> Augmented x vectors:- 1-class <-1,1,1> , <-1,1,0> , <-1,0,1> 0-class <-1,0,0> Negate 0-class:- <1,0,0> Prof. Pushpak Bhattacharyya, IIT Bombay

5 Example to demonstrate preprocessing (contd)
Now the vectors are x0 x1 x2 X X X X Prof. Pushpak Bhattacharyya, IIT Bombay

6 Intuition of the Algorithm (PTA)
1-class (0,1) 1-class (1,1) - + (0,0) (1,0) 1-class 0-class Correct config Initial Prof. Pushpak Bhattacharyya, IIT Bombay

7 Prof. Pushpak Bhattacharyya, IIT Bombay
Basic Steps of PTA Initialize the preprocessed perceptron randomly. Let x1, x2, …. xk be the preprocessed data vectors. Xi = <+/- 1, xi1, xi2,… xin> Test for wpxi > 0 for every I, where wp is the weight at pth iteration. If not, let xm be the ‘offending’ vector. wp+1 = wp + xm Prof. Pushpak Bhattacharyya, IIT Bombay

8 Basic Steps of PTA (contd)
6. Repeat from step 3 7. If wqxi > 0 for all i exit with success wq is the required weight. Prof. Pushpak Bhattacharyya, IIT Bombay

9 Tracing PTA on OR-example
w=<0,0,0> wx1 fails w=<-1,0,1> wx4 fails w=<0,0 ,1> wx2 fails w=<-1,1,1> wx1 fails w=<0,1,2> wx4 fails w=<1,1,2> wx2 fails w=<0,2,2> wx4 fails w=<1,2,2> success Prof. Pushpak Bhattacharyya, IIT Bombay

10 Prof. Pushpak Bhattacharyya, IIT Bombay
Convergence of PTA Perceptron Training Algorithm (PTA) Statement: Whatever be the initial choice of weights and whatever be the vector chosen for testing, PTA converges if the vectors are from a linearly separable function. Prof. Pushpak Bhattacharyya, IIT Bombay

11 Proof of Convergence of PTA
Suppose wn is the weight vector at the nth step of the algorithm. At the beginning, the weight vector is w0 Go from wi to wi+1 when a vector xj fails the test wixj>0 and update wi as wi+1 = wi + xj Since xjs form a linearly separable function,  w* s.t. w*xj > 0 j Prof. Pushpak Bhattacharyya, IIT Bombay

12 Proof of Convergence of PTA (contd)
Suppose wn is the weight vector at the nth step of the algorithm. At the beginning, the weight vector is w0 Go from wi to wi+1 when a vector xj fails the test wixj > 0 and update wi as wi+1 = wi + xj Since xjs form a linearly separable function,  w* s.t. w*xj > 0 j Prof. Pushpak Bhattacharyya, IIT Bombay

13 Behavior of Numerator of G
wn . w* = (wn-1 + xn-1fail ) . w* wn-1 . w* + xn-1fail . w* (wn-2 + xn-2fail ) . w* + xn-1fail . w* ….. w0 . w* + ( x0fail + x1fail xn-1fail ). w* Suppose |xj| ≥  , where  is the minimum magnitude. Num of G ≥ |w0 . w*| + n  . |w*| So, numerator of G grows with n. Prof. Pushpak Bhattacharyya, IIT Bombay

14 Behavior of Denominator of G
|wn| =  wn . wn  (wn-1 + xn-1fail )2  (wn-1) wn-1. xn-1fail + (xn-1fail )2  (wn-1)2 + (xn-1fail )2 (as wn-1. xn-1fail ≤ 0 )  (w0)2 + (x0fail )2 + (x1fail )2 +…. + (xn-1fail )2 |xj| ≤  (max magnitude) So, Denom ≤  (w0)2 + n2 Prof. Pushpak Bhattacharyya, IIT Bombay

15 Prof. Pushpak Bhattacharyya, IIT Bombay
Some Observations Numerator of G grows as n Denominator of G grows as  n => Numerator grows faster than denominator If PTA does not terminate, G(wn) values will become unbounded. But, as |G(wn)| ≤ |w*| which is finite, this is impossible! Hence, PTA has to converge. Proof is due to Marvin Minsky. Prof. Pushpak Bhattacharyya, IIT Bombay

16 Prof. Pushpak Bhattacharyya, IIT Bombay
Exercise Look at the geometric proof of convergence of PTA from the book M. L. Minsky and S. A. Papert. Perceptrons, Expanded Edition. MIT Press, 1988. Prof. Pushpak Bhattacharyya, IIT Bombay


Download ppt "ARTIFICIAL INTELLIGENCE"

Similar presentations


Ads by Google