




























Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
A laboratory manual for final year computer science and engineering students studying soft computing at tpct's college of engineering, osmanabad. The manual includes matlab programs for implementing andnot, xor, and and functions using mcculloch-pitts neural net and perceptron. It also covers pattern storage using discrete hopfield network.
Typology: Schemes and Mind Maps
1 / 36
This page cannot be seen from the preview
Don't miss anything!
To achieve and evolve as a center of academic excellence and research center in the field of Computer Science and Engineering. To develop computer engineers with necessary analytical ability and human values who can creatively design, implement a wide spectrum of computer systems for welfare of the society.
The department strives to continuously engage in providing the students with in-depth understanding of fundamentals and practical training related to professional skills and their applications through effective Teaching- Learning Process and state of the art laboratories pertaining to CSE and inter disciplinary areas. Preparing students in developing research, design, entrepreneurial skills and employability capabilities.
It is my great pleasure to present this laboratory manual for Final year Engineering students for the subject – “ Soft Computing”.
As a student, many of you may be wondering with some of the questions in your mind regarding the subject and exactly what has been tried is to answer through this manual
Faculty members are also advised that covering these aspects in initial stage itself will greatly relieve them in future as much of the load will be taken care by the enthusiasm energies of the students once they are conceptually clear
CSE Dept.
This manual is intended for the final year students of Computer Science and Engineering in the subject of Soft Computing. This manual typically contains practical/Lab Sessions related to the subject on the MATLAB/Scilab platform covering various aspects of the subject to enhance understanding.
Students' are advised to thoroughly go through this manual rather than only topics mentioned in the syllabus as practical aspects are the key to understanding and conceptual visualization of theoretical aspects covered in the books.
Mr. R.A.Sarwade.
Questions:
1] What do you mean by MATLAB? 2] Describe all MATLAB windows in detail.(command window, Graphics window , Editor window, Workspace, command history, current directory) 3] Describe all basic MATLAB command with example
Title: Generate ANDNOT function using McCulloch-Pitts neural net by MATLAB Program.
Objectives:
Instructions: 1.Study MP Model 2.Study logic gates: AND,OR,NOT,Exclusive-OR 3.Write a program to implement ANDNOT gate without using neural network toolbox.
%ANDNOT function using McCulloch-Pitts neuron clear; clc; % Getting weights and threshold value disp('Enter the weights'); w1=input('Weight w1='); w2=input('Weight w2='); disp('Enter threshold value'); theta=input('theta='); y=[0 0 0 0]; x1=[0 0 1 1]; x2=[0 1 0 1]; z=[0 0 1 0]; con=1; while con zin = x1w1+x2w2; for i=1: if zin(i)>=theta y(i)=1; else y(i)=0; end end disp('Output of net='); disp(y); if y==z con=0; else
Title: Generate XOR function using McCulloch-Pitts neural net by MATLAB program.
Objectives:
Instructions: 1.Study MP Model 2.Study logic gates: AND,OR,NOT,Exclusive-OR 3.Write a program to implement XOR gate without using neural network toolbox.
% XOR function using McCulloch-Pitts neuron clear; clc; % Getting weights and threshold value disp('Enter the weights'); w11=input('Weight w11='); w12=input('Weight w12='); w21=input('Weight w21='); w22=input('Weight w22='); v1=input('Weight v1='); v2=input('Weight v2='); disp('Enter threshold value'); theta=input('theta='); x1=[0 0 1 1]; x2=[0 1 0 1]; z=[0 1 1 0]; con=1; while con zin1 = x1w11+x2w21; zin2 = x1w21+x2w22; for i=1: if zin1(i)>=theta y1(i)=1; else y1(i)=0; end if zin2(i)>=theta y2(i)=1; else y2(i)=0; end end
yin=y1v1+y2v2; for i=1: if yin(i)>=theta; y(i)=1; else y(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'); w11=input('Weight w11='); w12=input('Weight w12='); w21=input('Weight w21='); w22=input('Weight w22='); v1=input('Weight v1='); v2=input('Weight v2='); theta=input('theta='); end end disp('McCulloch Pitts Net for XOR function'); disp('Weights of neuron Z1'); disp(w11); disp(w21); disp('Weights of neuron Z2'); disp(w12); disp(w22); disp('Weights of neuron Y'); disp(v1); disp(v2); disp('Threshold value='); disp(theta);
Title: Write a program for solving linearly separable problem using Perceptron Model.
Objectives: To implement AND function using Perceptron
Instructions:
Program to implement AND function:
end epoch=epoch+1; end
disp('Perceptron for AND Function'); disp('Final Weight Matrix'); disp(w); disp('Final Bias'); disp(b);
Output :-
Enter Learning rate= Enter Threshold Value=0. Perceptron for AND Function Final Weight Matrix 1 1 Final Bias
Title: Write a program to store a pattern (1 1 1 0). Test the network using Discrete Hopfield Net by giving the input with mistakes in First and Second position.
Objectives: To understand the concept of Pattern storage To implement Discrete Hopfield Net
Training Algorithm: Describe about Pattern Storage networks Write theory for Hopfield Net.
MATLAB Source Code:
%Discrete hopfield net clc; clear; x=[1 1 1 0]; tx=[0 0 1 0]; w=(2x'-1)(2x-1); for i=1: w(i,i)=0; end con=1; y=[0 0 1 0]; while con up=[4 2 1 3]; for i=1: yin(up(i))=tx(up(i))+yw(1:4,up(i)); if yin(up(i))> y(up(i))=1; end end if y==x disp('convergence has been obtained'); disp('the converged output'); disp(y); con=0; end end
Output:
%convergence has been obtained %the converged output % 1 1 1