# Soft Computing Practical File

4081 Words17 Pages
practaSAGAR INSTITUTE OF RESEARCH AND TECHNOLOGY SOFT COMPUTING PRACTICAL FILE (CS-801) Subject Guide: Submitted by: INDEX S.No. | List of Experiments | Signature | 1. | Implement Perceptron network with binary input and output. | | 2. | Using Madaline net, generate XOR function with bipolar inputs and targets. | | 3. |…show more content…
Program: /*BACK PROPAGATION NETWORK*/ #include&lt;stdio.h&gt; #include&lt;conio.h&gt; #include&lt;math.h&gt; #include&lt;stdlib.h&gt; void main() {float v,w,vc,wc,de,del,bl,bia,bc,e=0; float x,t,zin,delin,yin=0,y,dy,dz,b,z,es,alp=0.02; int i,j,k=0,itr=0; v=0.1970; v=0.3191; v=-0.1448; v=0.3594; v=0.3099; v=0.1904; v=-0.0347; v=-0.4861; w=0.4919; w=-0.2913; w=-0.3979; w=0.3581; b=-0.3378; b=0.2771; b=0.2859; b=-0.3329; bl=-0.141; x=-1; x=-1; x=-1; x=1; x=1; x=-1; x=1; x=1; t=0; t=1; t=1; t=0; clrscr(); for(itr=0;itr&lt;=387;itr++) {e=0; es=0; for(i=0;i&lt;=3;i++) {do { for(j=0;j&lt;=1;j++) {zin[k]+=x[i][j]*v[j][k];} zin[k]+=b[k]; k+=1; }while(k&lt;=4); for(j=0;j&lt;=3;j++) {z[j]=(1-exp(-zin[j]))/(1+exp(-zin[j])); dz[j]=((1+z[j])*(1-z[j]))*0.5;} for(j=0;j&lt;=3;j++) {yin+=z[j]*w[j];}