0% found this document useful (0 votes)
13 views3 pages

Perceptron Learning Rule Implementation

The document describes the Perceptron Learning Rule, detailing the process of training a perceptron using a given dataset and updating weights and bias over multiple epochs. It includes a Python implementation outline for an Adaline neural network focused on an AND gate. The results show the actual versus estimated outputs after training.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views3 pages

Perceptron Learning Rule Implementation

The document describes the Perceptron Learning Rule, detailing the process of training a perceptron using a given dataset and updating weights and bias over multiple epochs. It includes a Python implementation outline for an Adaline neural network focused on an AND gate. The results show the actual versus estimated outputs after training.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Perceptron Learning Rule

• Apply Perceptron Rule Learning to get the final W values, Test the system
after training

data= [Link] ( [ 1, 1, 1, 1],


[ 1, 0, 1, -1],
[ 0, 1, 1, -1],
[ 0, 0, 1, -1])
Perceptron Learning Rule
w1=w2=b=0; a=1; 𝜃=0.2

For epoch from 1 to 10


data= [Link] ( [ 1, 1, 1, 1],
For i from 0 to nSample
[ 1, 0, 1, -1],
𝑌𝑖𝑛 = 𝑏 + σ 𝑋𝑖 × 𝑤𝑖
[ 0, 1, 1, -1],
if 𝑌𝑖𝑛 > 𝜃 Then y=1
[ 0, 0, 1, -1])
if −𝜃 ≤ 𝑌𝑖𝑛 ≤ 𝜃 Then y=0
if 𝑌𝑖𝑛 < −𝜃 Then y=-1
HW. Write a Python program
to implement Adaline NN.
if y ≠ 𝑡𝑖 Then
(And gate).
𝑤𝑖 = 𝑤𝑖 + 𝑎 × 𝑡𝑖 × 𝑥𝑖
𝑏𝑖 = 𝑏𝑖 + 𝑎 × 𝑡𝑖
Print w1, w2, b
Result
Acutal_Y estimated_Y
1 1
-1 -2
-1 -1
-1 -4

You might also like