Wecanseethelossfunctionsright, Butstill, I don't haveananimation.
Sowhat I wanttodois I wantthistobeanasynchronousfunction.
I wantthisfunctiontobein a singledysfunctiontohappenandletthingskeepgoing.
Andguesswhat.
I have a videoseriesabout a dothatwiththekeyword a sink.
Andthenif I sayace, if I make a function a sink, I canusethekeywordawaitmeaningthisfunctionwillwaitformodelthatfittofinishbeforeit's done.
Anditreturns a promise, bytheway, um, so I canactuallytakethisnow I couldsaywouldturnawait, Andthen I canputmythenupherebecauseit's gonnareturnthatsamepromise.
Butitwillhappen.
A synchronouslymeaningitwill.
Thecodeupherewillbeallowedtomoveon.
Well, thisishappeninginthebackgroundintheory, but I'vegottodomorehere.
It's thesamebehavior.
Sowhyisitthething?
Maybewell, I'vesetmyselfupforsuccess, but I don't havesuccessyet.
Andthereasonwhyisthat?
TensorflowdotJsHe's usingsomethingcalledWeb G L todoallofthecalculations, andit's takingoverbasicallyyouranimationordrawingcapabilitieswhileyou'refittingthemodel.
However, tensorflowdotJscomeswith a functioncalledNextFrame, whichreturns a promisethatresolveswhen a requestanimationframehasbeencompleted.
It's simply a sugarmethodsothatuserscandothefollowingawaitTFnextframe.
Sowhat I canactuallydoiskindoftriggertheanimationlettingthroughthedrawloopgothe p fiveJessDraw.
Loveisjustusingrequestanimationframeitselfbyadding a weightTFnextframe.
Somehow, inthis a sinkfunction.
Sowheredo I addit?
So I haveanidea.
I'm goingtoaddsomethingtothiscalledcallbackssoand I gottaspellcallbackscorrectlyforthistowork.
Let's atleastsowhat I reallyshoulddoisgrass, thelossfunction, andbytheway, I canlookatthelostfunctionattheendofeachbatchso I canget a muchmorequicklyupdatedlostfunction.
So I'm gonnaleavethatasanexercisetotheviewer.
But I'm gonnaJustWhat I'm gonnadois I'm gonnasay, uh, letlost p onand I'm gonnacreate a paragraphelementagain.
Sonow I haveananimationgoingandthenassumesthatgettotheendofthefirstepoch.
I havetoetalkfor a bit.
Here, I seethelostfunction.
Sonow I'm trainingandgetting a reportofthelostfunction.
Soforyouinthenextvideo, what I'm gonnaaddisinferenceorprediction.
I'm gonnaallowtheuserwithsliderstospecify a colorandhavethelabelreturntomeandwhat I wouldsaythatyouasanexerciseandseewhathappensifyoucanquerythelossfunctionwiththepatcheson, graphitovertimeandsee.
See, thatwouldbeanexercisetoyouasthevieweron.
And I'm gonnapublish a gethubRepowiththisfinishedprojectsoyoucanlookfortheclothesVeryconfusing.
Soonemorevideotogo, I think, andthensomeotherancillaryonesthat I'veforgottenabout, butonemorecorevideotothistutorialserieswhichisaddingthepredictionand I willseeyou.
Ifyou'rereallygonnawatchallofthese, I willseeyouinthenextvideo.