function slide=demop6
% This is a slideshow file for use with playshow.m and makeshow.m
% To see it run, type 'playshow demop6', 

% Copyright (c) 1992-1998 by The MathWorks, Inc.
% $Revision: 1.10 $  $Date: 1998/06/11 16:23:45 $

if nargout<1,
  playshow demop6
else
  %========== Slide 1 ==========

  slide(1).code={
   'slideData=nnslides(''start'',slideData,''Linearly Non-Separable Input Vectors'');' };
  slide(1).text={
   'NEWP  - Creates a perceptron.',
   'SIM  - Simulates a neural network.',
   'TRAIN - Trains a neural network.',
   '',
   'Using the above functions a 2-input hard limit neuron fails to properly classify 5 input vectors because they are linearly non-separable.'};

  %========== Slide 2 ==========

  slide(2).code={
   'slideData=nnslides(''axes'',slideData);',
   'P = [-0.5 -0.5 +0.3 -0.1 -0.8;   -0.5 +0.5 -0.5 +1.0 +0.0];',
   'T = [1 1 0 0 0];',
   'plotpv(P,T);' };
  slide(2).text={
   'Each of the five column vectors in P defines a 2-element input vectors:',
   'A row vector P defines five 2-element input vectors:',
   '>> P = [-0.5 -0.5 +0.3 -0.1 -0.8;',
   '            -0.5 +0.5 -0.5 +1.0 +0.0];',
   'A row vector T defines the vector''s target categories.',
   '>> T = [   1      1     0     0    0];',
   'Now plot these vectors with PLOTPV:',
   '>> plotpv(P,T);'};

  %========== Slide 3 ==========

  slide(3).code={
   'net=newp([-40 1;-1 50],1);' };
  slide(3).text={
   'The perceptron must properly classify the input vectors in P into the categories defined by T.  Because the two kinds of input vectors cannot be separated by a straight line, the perceptron will not be able to do it.',
   'NEWP creates a perceptron.',
   '>> net=newp([-2 2; -2 2],1);'};

  %========== Slide 4 ==========

  slide(4).code={
   'plotpv(P,T);',
   'linehandle=plotpc(net.IW{1},net.b{1});' };
  slide(4).text={
   'The input vectors are replotted...',
   '>> plotpv(P,T)',
   '...with the neuron''s initial attempt at classification.',
   '>> plotpc(net.IW{1},net.b{1})',
   'The initial weights are set to zero, so any input gives the same output and the classification line does not even appear on the plot.'};

  %========== Slide 5 ==========

  slide(5).code={
   'slideData=nnslides(''lock'',slideData);',
   'plotpv(P,T);',
   'linehandle=plotpc(net.IW{1},net.b{1});',
   'for a=1:25',
   '   [net,Y,E]=adapt(net,P,T);',
   '   linehandle=plotpc(net.IW{1},net.b{1},linehandle);  drawnow;',
   'end;',
   'slideData=nnslides(''unlock'',slideData);' };
  slide(5).text={
   'ADAPT returns a new network object that performs as a better classifier, the network outputs, and the error.  This loop allows the network to adapt for one pass, plots the classification line, and stops after 25 iterations.',
   '>> for a=1:25;',
   '>>   [net,Y,E]=adapt(net,P,T);',
   '>>   linehandle=plotpc(net.IW{1},net.b{1},linehandle);  drawnow;',
   '>> end;'};

  %========== Slide 6 ==========

  slide(6).code={
   '' };
  slide(6).text={
   'Note that zero error was never obtained.  Despite training, the perceptron has not become an acceptable classifier.  Only being able to classify linearly separable data is the fundamental limitation of perceptrons.'};
end