Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
93 views1 page

Neural Networks - Homework 1

This homework assignment from Cyprus International University asks students to: 1. Implement the Perceptron Learning Algorithm in a programming language to classify inputs for a 2-input perceptron. The algorithm updates weights to minimize error between actual and desired outputs. 2. Test the implementation on basic Boolean AND and OR functions. Initial weights are set to 0.1 and 0.4. 3. Submit a report and simulation codes through the university's online learning system.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
93 views1 page

Neural Networks - Homework 1

This homework assignment from Cyprus International University asks students to: 1. Implement the Perceptron Learning Algorithm in a programming language to classify inputs for a 2-input perceptron. The algorithm updates weights to minimize error between actual and desired outputs. 2. Test the implementation on basic Boolean AND and OR functions. Initial weights are set to 0.1 and 0.4. 3. Submit a report and simulation codes through the university's online learning system.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

CYPRUS INTERNATIONAL UNIVERSITY

ENGINEERING FACULTY
NEURAL NETWORKS MODELING AND ANALYSIS

HOMEWORK 1

Q1) Implement the Perceptron Learning Algorithm given below for 2-input perceptron by
using any programming language.

 Learning Algorithm steps:


1. Initialise weights and threshold.
Set wi(t), (1 ≤ i ≤ m) to be the weight i at time t, and ø to be the threshold value in the output
node.
Set wi to small random values, thus initialising the weights and threshold.
2. Present input and desired output
Present input x0 and x1,x2,...,xm and desired output d(t)
3. Calculate the actual output
y(t) = f[w0(t) x0(t)+ w1(t)x1(t) + w2(t)x2(t) + .... + wm(t)xm(t)]
4. Adapts weights
wi(t + 1) = wi(t) + µ[d(t) − y(t)]xi(t) , for .
Steps 3 and 4 are repeated until the iteration error is less than a user-specified error threshold
or a predetermined number of iterations have been completed.

Use learning rate as 0.1 in your implementation.

Q2) Test your implementation with basic Boolean functions given below, by using initial
weights of 0.1 , 0.4.

AND OR
X0 X1 Y X0 X1 Y

+1 +1 +1 +1 +1 +1
+1 -1 -1 +1 -1 +1
-1 +1 -1 -1 +1 +1
-1 -1 -1 -1 -1 -1

Submission: Upload your report and your simulation codes through moodle.

You might also like