Thatkindofstuffisgoingtobelikedescriptivefeatures, andatsomepointwehavetoconvertthattonumerical, soyoucouldjustdolike a, likejustsimply, thefirstthingis a zero.
Oneofthekeyconceptsthat I justkeepcominguptimeandtimeagainisthatingeneral, neuralnetworksappreciatevaluesbetweenzeroandoneornegativeoneandoneinsomecases.
Soitjustkeepstweakingallofthosesothatwhenwepassdatawhenwetrainintheoldnetwork, we'repassinginthisinputdataandwe'retellingit, let's sayitreallyis a pictureof a human.
Wewouldsaythedesiredoutput.
Theoutput I wishyouwouldmakeinthiscaseis a 001 Right?
Nowchancesareyou'veheardofforsure, Tensorflow, whichisanothermachinelearninglibrary, andthere's quite a fewothers I wanttousepytorchone.
I juststart.
I justdecidedonedaytolearnpytorchmyself, andas I waslearningit, I waslike, Thiswouldbe a reallygoodlanguagetodo a beginner's deeplearningSiri's becausePytorchislikesuperfriendlytotheprogrammer, especially a pythonprogrammerasopposedtoTensorflow.
Butpytorchisfasterthaneagertensorflow, andthatwouldbethemorefaircomparisonbecausePytorchiseagerandwhat I meanbythat I mean, youcanwrite a lineofcodeinpytorchlikeyoucanhaveyournetworkandthenyourunlikeonelineoryourunthroughonelayerandthenyoucouldchecktheoutputandyoucanseeit.
I amgoingtopausefor a momentandassumeyouguyswhen I wouldhavedonepausinggoingtoassumeyouhavepytorchinstalled.
Great.
Congratulationsonyourinstall.
Sothefirstthing I'm gonnadoisfigureout.
Do I haveOh, I doalreadyopeneditup.
Nice.
So, uh, I'm gonnabecodingthingsintheJupiterlab, butyoucanusewhatevereditoryouwant, causeremember, youguyshavedoneyourleastnotbasicprogrammersanymore.
So I'm assumingyouguyscanhaveyourowneditorandbefine.
I'm goingtouseJupiternotebookjustbecauseone I canyeaforeagerexecution, butalsobecauseitjustkindofmakessense a T Eastwhenyou'retryingtolearnthevery, verybasics, runninglinebylineisjustuseful.
Nowtheproblemwithsomepieiswhat I justexplainedmomentsagoisthatitdoesn't runontheGPU.
Sowhateverdeeplearningfirstcameout, therewasreallyitwasverydifficulttototoreallyrunthesethingsbecausetheyourCPU, thereasonwhythingsaresomuchfasteronyourGPyouiswith a neuralnetwork.
Like I saidthatthethingthatishappeningiseachoftheswaitsisgettingupdated, soyourmachineisneedingtorunthousandsandthousandsofoperationof a smallcatlike, noteventhoughtlikemillionsofsmallcalculations.
SoSorunningontheGPwaswherewewanttobeforsomethinglikedeeplearning, becausewhatwe'retryingtodois a lotofsimplecalculations.
InterJeep, likeyourCPUprobablyhassomethingbetween I don't know, fourand 12 cores.
Okay, A niceGPUhas, likethousands, ofcourse, soit's justitmakes a bigdifference.
So, uh, letmecomeoverhere.
AndsoSo, like I said, pytorchisjustnumbpieontheGPUwithsomenicehelperfunctionsbecause a lotlikelike, youdon't havetowriteyouroptimizerandyou'rebackpropagationandallthesethingsThatprobablymightnotmeananythingtoyouyet, butwe'llsoon.
Butitisbasicpoor.
Let's goaheadandimporttorchandcan I pressuretofigurethisoneoutfirst?
I wouldn't havemindedmakingmyfontsizelarger.
Gottabe a waybesideszoomingin, but I'lljustzoominfornow.
UmsoimporttorchAndthenlet's sayyou'vegottotwovariablesSowe'regonnasay X equalstorchdottensorUhand I mean, thiscouldgomanyways, butlet's saylike, fiveand a threeandthenyou'vegot y equalstorchedontenser.
Andwecanmakethis a twoin a one.
Wecouldthensayprint X timeswhy, it's gonnatake a secondtoimporttorchthere, butnormallythatoperationwillbemuchfaster.
Butyeah, wejustwejustmultipliedthesetwoarrays, so a tensorisinitiallykindof a scarysoundingword, butbasically a tensorisn't arraylikethat's allyouneedtothinkofrightum, andsobasically a multidimensionalarray.
Soanyways, inthenexttutorial, we'regonnadiscussdataandwe'regonnagoeasymodeonthedatafirstandthenonthenextneuralnetworkwebuildwillget a littlemorecomplicated, butanyways, we'veWe'vecovered a lotofbasicstuffhere, butwe'vecovered a lotofstuff.
Ifyouhavequestions, comments, concerns.
If I saidsomethingwrong, feelfreetocorrectme.
Um, youcanleavethosebelow.
Also, if a discord, it's discorddot g slashCentex.
Ifyou'vegotanyquestions, youhelponsomething.
Comecheckoutthediscord.
Alsospecial.
Shoutouttomychannelmemberswhohavebeenwithmenowfor a year.