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

Experiment 3: Aim: Generate or Functions Using Mcculloch-Pitts Neural Net by A Matlab Program

The document describes an experiment using MATLAB to generate an OR function using a McCulloch-Pitts neural network. The aim is to generate an OR function with a MATLAB program. The theory section explains the McCulloch-Pitts model of a neuron and how it can be used to classify inputs into two classes based on a linear threshold function. The MATLAB program implements the McCulloch-Pitts model to learn the weights and threshold to generate the correct output for an OR function.
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)
290 views3 pages

Experiment 3: Aim: Generate or Functions Using Mcculloch-Pitts Neural Net by A Matlab Program

The document describes an experiment using MATLAB to generate an OR function using a McCulloch-Pitts neural network. The aim is to generate an OR function with a MATLAB program. The theory section explains the McCulloch-Pitts model of a neuron and how it can be used to classify inputs into two classes based on a linear threshold function. The MATLAB program implements the McCulloch-Pitts model to learn the weights and threshold to generate the correct output for an OR function.
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
You are on page 1/ 3

EXPERIMENT 3

AIM: Generate OR functions using McCulloch-Pitts neural net by a MATLAB program.

APPARATUS: MATLAB software.

THEORY:
The McCulloch-Pitts Model of Neuron:
The early model of an artificial neuron is introduced by Warren McCulloch and Walter Pitts in
1943. The McCulloch-Pitts neural model is also known as linear threshold gate. It is a neuron of
a set of inputs

and one output

. The linear threshold gate simply classifies the

set of inputs into two different classes. Thus the output


described mathematically using these equations:

is binary. Such a function can be

(2.1)

(2.2)

are weight values normalized in the range of either


or
and
associated with each input line,
is the weighted sum, and
is a threshold constant. The
function is a linear step function at threshold
as shown in figure 2.3. The symbolic
representation of the linear threshold gate is shown in figure 2.4 [Has95].

Figure 2.3: Linear Threshold Function


Figure 2.4: Truth Table for OR gate

MATLAB PROGRAM:
clear;
clc;
disp('enter weights');
w1=input('weight w1=');
w2=input('weight w2=');
disp('enter threshold value');
theta=input('theta=');
y=[0 0 0 1];
x1=[0 0 1 1];
x2=[0 1 0 1];
z=[0 1 1 1];
con=1;
while con
zin=x1*w1+x2*w2;
for i=1:4
if zin(i)>=theta
y(i)=1;
else

y1(i)=0;
end
end
disp('output of net');
disp(y);
if y==z
con=0;
else
disp('net is not learning enter another set of weights and threshold value');
w1=input('weight w1=');
w2=input('weight w2=');
theta=input('theta=');
end
end
disp('McCulloch-Pitts net for OR function ')
disp('weights of neuron');
disp(w1);
disp(w2);
disp('threshold value');
disp(theta);

RESULT:
Enter weights
Weight w1=1
Weight w2=1
Enter Threshold Value
Theta=1
Output of Net
0111
McCulloch-Pitts Net for OR function
Weights of Neuron
1
1
Threshold value
1

You might also like