Question

Implement the Perceptron learning algorithm in any language.
Test your program for the following two problems:
a:
x0 x1 x2 y (class)
1   0   0      0
1   0   1      1
1   1   0      1
1   1   1      1
b:
x0 x1 x2 y (class)
1   0   0      0
1   0   1      0
1   1   0      0
1   1   1      1

Solution Preview

This material may consist of step-by-step explanations on how to solve a problem or examples of proper writing, including the use of citations, references, bibliographies, and formatting. This material is made available for the sole purpose of studying and learning - misuse is strictly forbidden.

The explanation of the program is quite straightforward. First of all, it was necessary to declare the needed constants as it follows:
The initial weights were chosen { -1.1, 1.5, 1.9}.
double boundary = 1.3; //threshold value
double learning = 0.05; //perceptron's learning rate (this must be small enough in order to catch enough stages of the training for the provided data set).
After that were declared the two data sets used for test cases (x0,x1,x2 and y).
The training of the data set is done in several steps included in a loop structure.
First of all, the evaluation of the weighted input was done using the formula Sum(xi*weight[i]), i=0,1 and 2...

This is only a preview of the solution. Please use the purchase button to see the entire solution

$63.00

or free if you
register a new account!

Assisting Tutor

Related Homework Solutions

Get help from a qualified tutor
Live Chats