Further Practice with Perceptrons
Demo:
Analyze the given program PerceptronExample, which consists of following parts:
- (1) Prepare mydata by generating 2 dimensional linearly separable data.
mydata = rand(500,2);
% Separate the data into two classes
acceptindex = abs(mydata(:,1)-mydata(:,2))>0.012; mydata = mydata(acceptindex,:); % data myclasses = mydata(:,1)>mydata(:,2); % labels
[m n]=size(mydata);
You may check the data distribution using:
scatter(mydata(:,1),mydata(:,2))
- (2) Train the perceptron by calling the function PerceptronTrn with the prepared training data (x, y), which will return the connection weights, the bias, and the number of iteration;
- (3) Test the trained Perceptron model with the testing data (xt, yt), by calling another function PerceptronTst, which will return the testing error;
- (4) Display the two classes of data points with a separating line.
Exercise:
- (1) The Perceptron training function uses a learning rate 0.5 and a threshold 0.5. Change these two parameters, e.g. learning rate 0.1 and threshold 0, and observe the differences;
- (2) Revise the program to calculate the Root-Mean-Square (RMS) error for every input data points and display the error curve, i.e. RMS vs. iteration.

![[Solved] INT301 Lab 4-Further Practice with Perceptrons](https://assignmentchef.com/wp-content/uploads/2022/08/downloadzip.jpg)

![[Solved] INT301 Lab 10-Radial Basis Function Neural Networks](https://assignmentchef.com/wp-content/uploads/2022/08/downloadzip-1200x1200.jpg)
Reviews
There are no reviews yet.