Transcription of Questions 4 - Middlesex University
1 Questions4Dr. RomanBelavkinBIS4435 Question1 Below is a diagramif a singlearti cialneuron(unit): >--ZZZZZ~vy='(v)w2x1x2x3w3w1 Figure1: (x1; x2; x3) thatreceive onlybinarysignals(either0 or 1).How many di erent inputpatternsthisnodecanreceive?Whatif thenodehadfourinputs?Five?Canyougive a formulathatcomputesthenumber of binaryinputpatternsfora given number of inputs?Answer:For threeinputsthenumber of combinationsof 0 and1 is 8:x101010101x200110011x300001111andforfo urinputsthenumber of combinationsis 16:x10101010101010101x20011001100110011x 30000111100001111x40000000011111111 Youmay check thatfor ve inputsthenumber of combinationswillbe = 23,16= 24and32= 25(forthree,fourand ve inputs).Thus,theformulaforthenumber of binaryinputpatternsis:2n;wherenin thenumber of inputs1 BIS44352 Question2 ConsidertheunitshownonFigure1.
2 Supposethattheweights correspond-ingto thethreeinputshave thefollowingvalues:w1=2w2= 4w3=1andtheactivationof theunitis givenby thestep{function:'(v) =(1ifv 00otherwiseCalculatewhatwillbe theoutputvalueyof theunitforeach of thefollowinginputpatterns:PatternP1P2P3P 4x11011x20101x30111 Answer:To ndtheoutputvalueyforeach patternwe have to:a)Calculatetheweightedsum:v=Piwixi=w1 x1+w2 x2+w3 x3b)ApplytheactivationfunctiontovThecalc ulationsforeach inputpatternare:P1:v= 2 1 4 0 + 1 0 = 2;(2>0);y='(2)= 1P2:v= 2 0 4 1 + 1 1 = 3;( 3<0); y='( 3) = 0P3:v= 2 1 4 0 + 1 1 = 3;(3>0);y='(3)= 1P4:v= 2 1 4 1 + 1 1 = 1;( 1<0); y='( 1) = 0 Question3 Logicaloperators( ,AND,OR,XOR,etc)arethebuildingblocksof any possiblevalues,trueor false,basedonthetruthor falsevaluesof example,operatorANDreturnstrueonlywhenal litsarguments aretrue,otherwise(if any of thearguments is false)it we denotetruthby 1 andfalseby 0, thenlogicalfunctionANDcanbe representedbythefollowingtable:x1:0101x2 :0011x1 ANDx2:0001 Thisfunctioncanbe implementedby a single{unitwithtwo inputs:BIS44353 *-HHHHjvy='(v)w1w2x2x1if theweights arew1= 1 andw2= 1 andtheactivationfunctionis:'(v) =(1ifv 20otherwiseNotethatthethresholdlevel is 2 (v 2).}}
3 A)Testhow :P1:v= 1 0 + 1 0 = 0;(0<2); y='(0)= 0P2:v= 1 1 + 1 0 = 1;(1<2); y='(1)= 0P3:v= 1 0 + 1 1 = 1;(1<2); y='(1)= 0P4:v= 1 1 + 1 1 = 2;(2 = 2); y='(2)= 1b)Suggesthow to changeeithertheweights or thethresholdlevel of thissingle{unitin orderto implement thelogicalORfunction(truewhenat leastoneof thearguments is true):x1:0101x2:0011x1 ORx2:0111 Answer:Onesolutionis to increasetheweights of theunit:w1= 2andw2= 2:P1:v= 2 0 + 2 0 = 0;(0<2); y='(0)= 0P2:v= 2 1 + 2 0 = 2;(2 = 2); y='(2)= 1P3:v= 2 0 + 2 1 = 2;(2 = 2); y='(2)= 1P4:v= 2 1 + 2 1 = 4;(4>2); y='(4)= 1 Alternatively, we couldreducethethresholdto 1:'(v) =(1ifv 10otherwiseBIS44354c)TheXORfunction(excl usive or)returnstrueonlywhenoneof thearguments is trueandanotheris ,it representedby thefollowingtable:x1:0101x2:0011x1 XORx2:0110 Doyouthinkit is possibleto implement thisfunctionusinga singleunit?}
4 A networkof severalunits?Answer:Thisis a di cultquestion,andit puzzledscientistsforsometimebecauseit is actuallyimpossibleto implement theXORfunctionneitherby a singleunitnorby a single{layer feed{forwardnetwork(single{layer perceptron).Thiswas knownas feed{ a feed{forwardneuralnetworkwithonehiddenla yer: >--ZZZZZZZ~------ZZZZZZ~ >123456A weight onconnectionbetweennodesiandjis denotedbywij, such asw13is theweight ontheconnectionbetweennodes1 and3. Thefollowingtablelistsalltheweights in thenetwork:w13= 2w35= 1w23= 3w45= 1w14= 4w36= 1w24= 1w46= 1 Each of thenodes3, 4, 5 and6 usesthefollowingactivationfunction:'(v) =(1ifv 00otherwisewherevdenotestheweightedsumof a of theinputnodes(1and2) canonlyreceive binaryvalues(either0 or 1).Calculatetheoutputof thenetwork(y5andy6) foreach of theinputpatterns:BIS44355 Pattern:P1P2P3P4 Node1:0101 Node2:0011 Answer:Inorderto ndtheoutputof thenetworkit is necessarytocalculateweightedsumsof hiddennodes3 and4:v3=w13x1+w23x2;v4=w14x1+w24x2 Then ndtheoutputsfromhiddennodesusingactivati onfunction':y3='(v3);y4='(v4):Usetheoutp utsof thehiddennodesy3andy4as theinputvaluesto theoutputlayer (nodes5 and6),and ndweightedsumsof outputnodes5 and6:v5=w35y3+w45y4;v6=w36y3+w46y4:Final ly, ndtheoutputsfromnodes5 and6 (alsousing'):y5='(v5);y6='(v6):Theoutput patternwillbe(y5; y6).)}}}}}
5 Performthesecalculationforeach inputpattern:P1: Inputpattern(0;0)v3= 2 0 + 3 0 = 0;y3='(0)= 1v4= 4 0 1 0 = 0;y4='(0)= 1v5= 1 1 1 1 = 0;y5='(0)= 1v6= 1 1 + 1 1 = 0;y6='(0)= 1 Theoutputof thenetworkis(1;1).P2: Inputpattern(1;0)v3= 2 1 + 3 0 = 2;y3='( 2) = 0v4= 4 1 1 0 = 4;y4='(4)= 1v5= 1 0 1 1 = 1;y5='( 1) = 0v6= 1 0 + 1 1 = 1;y6='(1)= 1 Theoutputof thenetworkis(0;1).P3: Inputpattern(0;1)v3= 2 0 + 3 1 = 3;y3='(3)= 1v4= 4 0 1 1 = 1;y4='( 1) = 0v5= 1 1 1 0 = 1;y5='(1)= 1v6= 1 1 + 1 0 = 1;y6='( 1) = 0 Theoutputof thenetworkis(1;0).BIS44356P4: Inputpattern(1;1)v3= 2 1 + 3 1 = 1;y3='(1)= 1v4= 4 1 1 1 = 3;y4='(3)= 1v5= 1 1 1 1 = 0;y5='(0)= 1v6= 1 1 + 1 1 = 0;y6='(0)= 1 Theoutputof thenetworkis(1;1).Question5 Whatis a trainingsetandhow is it usedto trainneuralnetworks?
6 Answer:Trainingsetis a setof pairsof pairrepresents how thenetworkis supposedto respondto a trainedto respondcorrectlyto each may thinkofa supervisedlearningas learningwitha teacher,andthetrainingsetas asetof ,whenpresentedwithinputpatterns,gives `wrong'answers(notdesiredoutput).Theerro ris usedtoadjusttheweights in thenetworkso thatnexttimetheerrorwas repeatedusingmany examples(pairsof inputsanddesiredoutputs)fromthetrainings etuntil theerrorbecomessu anepoch?Answer:Anepoch is whenallof thedatain thetrainingsetis presentedto themainstepsof thesupervisedtrainingalgorithm?Answer: Initially, setalltheweights to somerandomvalues Repeat(formany epochs):a)Feedthenetworkwithaninputfromo neof theexamplesin thetrainingsetBIS44357b)Computetheerrorb etweentheoutputof thenetworkandthedesiredoutputc)Correctth eerrorby adjustingtheweights of thenodes Until theerroris su cientlysmallQuestion8 Supposethata creditcardcompany decidedto deploy a newsystemforassessingcreditworthinessof usingafeed{forwardneuralnetworkwitha a formof essay whatshouldthebankhave beforethesystemcanbe used?}
7 :Theanswer shouldmentionthatthecompany shouldgetholdofhistoricaldataaboutitscus tomerswhoalreadytook creditin isimportant thatthedataisrepresentativeandcoversasma ny types becausethenetworkwillnotbe abletoproduceanaccurateanswer fora customerverydi erent fromthosein thetrainingset.