I imagineyouhad a fourpixelcamera, sonotnotformegapixels, butjustfourpixels.
Anditwasonlyblackandwhite, andyouwantedtogoaroundandtakepicturesofthingsanddeterminedautomatically, thenwhetherthesepictureswereofsolid, allwhiteoralldarkimage, verticallineor a diagonallineor a horizontalline.
Itsvalueslook a lotlikeinputvalues, andwecanturnrightaroundandcreateanotherlayerontopofit, theexactsamewaywiththeoutputofonelayerbeingtheinputtothenextlayer.
Aswemovetothenextlayer, weseethesametypesofthingscombiningzerostogetzeros, um, combining a negativeandinnegativewiththenegativeweight, whichmakes a positivetoget a zero.
Andherewehavecombiningtwonegativestoget a negative.
Justthinkthatchangeinerrorwhen I change, awaitorthechangeinthethingonthetopwhen I changethethingonthebottom.
Um, thisis, uh, doesgetinto a littlebitofcalculus.
Wedotakederivatives.
It's howwecalculateslope.
Ifit's newtoyou, I stronglyrecommend a goodsemesterofcalculusjustbecausetheconceptsairsouniversaland, ah, a lotofthemhaveverynicephysicalinterpretations, which I findveryappealing.
Butdon't worry.
Otherwise, justglossoverthisandpayattentiontotherest, andyou'llget a generalsenseforhowthisworks.
Sointhiscase, ifwechangetheweightbyplusone, theerrorchangesbyminustwo, whichgivesus a slopeofminustwo.
ThiogothroughandtakethederivativeofthisanalyticallyandcalculatedItjustsohappensthatthisfunctionhas a nicepropertythattogetitsderivative, youjustmultiplyitbyoneminusitself.
Sothisisverystraightforwardtocalculate.
Anotherelementthatwe'veusedistherectifiedlinearunitagaintofigureouthowtobackpropagatethiswejustwriteouttherelation B isequalto a phasepositive.
Legal, labeled M andbeindicatethatwhatevergoesinontheleftcomesoutmultipliedbyemorbeontheright, andtheboxwiththeCapitalSigmaindicatesthatwhatevergoesinontheleftgetsaddedtogetherandspitoutontheright.
Wecanchangethenamesofallthesymbolsfor a differentrepresentation.
Onceyouhavevisited a node, there's nowaytojumpfromedgestonotestoedgestonotestogetbacktowhereyoustarted.
EverythingflowsinonedirectionThroughthegraph, wecanget a senseofthetypeofmodelsthatthisnetworkiscapableoflearningbychoosingrandomvaluesfortheweights w sub 00 and W sub 10 andthenseeingwhatrelationshippopsoutbetweenexceptoneandVisazero.
Wecanreducethistoeonesetofequations, adding a subscriptCapital L torepresentwhichlayerwe'retalkingabout.
Aswecontinuehere, we'llbeassumingthatallthelayersareidenticalandtokeeptheequationscleaner, we'llleaveoutthecapital l Butjustkeepinmindthatifweweregoingtobecompletelycorrectandverbose, wewouldaddthe l subscriptontotheendofeverythingtospecifythelayeritbelongsto.
Sonowif I'm connectingtheAIFinputtothe J ithoutput, then I and J willdeterminewhichwaitisappliedandwhichusegetaddedtogethertocreatetheoutput v sub J.
Andwecandothisasmanytimesaswewant.
Wecanaddasmanyofthesesharednotesaswecare, too.
Themodelas a wholeonLeeknowsabouttheinput.
X ofoneintothefirstlayerandtheoutputvisazerooffthelastlayerfromthepointofviewofsomeonesittingoutsidethemodelthesharednodesbetweenlayeroneandlatertoourhiddenthereinsidetheblackbox.
Theresultofthisisthatanythresholdwechoosefordoingclassifications, we'llsplitourinputspaceupintotwohalves, withthedividerbeing a straightline.
Thisiswhylogisticregressionisdescribedas a linearclassifier.
Whateverthenumberofinputsyouhave, whateverdimensionalspaceyou'reworkingin, logisticregressionwillalwayssplititintotwohalvesusing a lineor a planeor a hyperplaneoftheappropriatedimensions.
Weonlyshowtohiddennodesfromeachlayerhere, butinpracticeweusedquite a fewmoreagaintomakethediagramascleanaspossible.
Weoftendon't showallthehiddennodes.
Wejustshow a few, andtherestareimplied.
Here's a genericdiagram, thenfor a threelayersingleinputsingleoutputnetwork.
Noticethatifwespecifythenumberofinputs, thenumberofoutputsandthenumberoflayersandthenumberofhiddennodesineachlayer, thenwecanfullydefine a neuralnetwork.
Wecanalsotake a lookat a toinputsingleoutputneuralnetworkbecauseithastwoinputs.
Whenweplotit's outputs, itwillbe a threedimensionalcurve.
Ifwehopetofit a functionwith a lotofjaggedjumpsanddrops, thisneuralnetworkmightnotbeabletodo a verygoodjobofit.
However, asidefromthesetwolimitations, thevarietyoffunctionsthatthisneuralnetworkcanproduceis a littlemindboggling.
Wemodified a singleoutputneuralnetworktobe a classifier.
WhenwelookoutofthemultilayerPerceptron.
Nowthere's anotherwaytodothis.
Wecanuse a twooutputneuralnetworkinstead.
Outputsof a threelayeroneinputtooutputneuralnetworklikethis, wecanseethattherearemanycaseswherethetwocurvescross, andinsomeinstancestheycrossinseveralplaces.
Similarly, ifyoufeedit a bunchofimagesofcarsdownatthelowestlayer, you'llgetthingsagainthatlooklikeedgesandthenhigherupthingsthatlookliketires, wheelwellsandhoods.
Andit a levelabovethat, thingsthatareclearlyidentifiable.
Hiscars.
CNN's couldevenlearntoplayvideogamesbyformingpatternsofthepicklesastheyappearonthescreenandlearningwhatisthebestactiontotakewhenitsees a certainpattern, CNNcanlearntoplayvideogamesinsomecasesfarbetterthan a humanevercould.
Notonlythat, ifyoutake a coupleofCNN's andhavethemsettoewatchingYouTubevideos, onecanlearnobjects.
I againpickingoutpatterns, andtheotheronecanlearntypesofgrasps.
This, thencoupledwithsomeotherexecutionsoftware, canlet a robotlearntocookjustbywatchingYouTube, sothere's nodoubtCNN's orpowerful.
Sotostepthroughthistoseewhyitmakessensetodothis, youcanseestartingintheupperlefthandpixelinboththefutureandtheimagepatchmultiplyingtheonebioonegivesyou a one, andwecankeeptrackofthatbyputtingthatintopositionoffthepixelthatwe'recomparing.