hiandwelcometocodingTensorflow, a showwherewefocusoncodingmachinelearningandAIaiapplications.
I'm LaurenceMaroney, a developeradvocatefortensorflow, andinthisepisodewe'regoingtocontinueourseriesaboutusingJavaScriptformachinelearninginthebrowser.
ThisisachievedusingtensorflowdotJs a JavaScriptlibraryfortraininganddeployingMLmodelsinthebrowseronDon't KnowJs.
There's lotsofgreatinformationaboutitonthe J s stocktensorflowdotorg's sight, includingsamples, a P I docksandfrequentlyaskedquestions.
Inthefirstepisode, wetook a verybasiclookatwhatyouneedtogetupandrunningwithtensorflowinthebrowserbybuilding a simplemodelthatfitsitsvaluestoalignbylearningthatitisactually a lineoffof a verysmalltrainingsetinEpisodetwo.
Wedidthisbytaking a populardata, setsthatforclassificationoftheirisfloweronTurneditfromRossi s V into a numberoftensesirs, thosewithfeaturedataandthosewouldlabeldataforbothtrainingandtestsets.
Nowthatthedataisreadyinthisepisode, we'lltake a lookathowyoucancreate a neuralnetworktoebuild a modelthatcanbeusedtoclassifyfuturedata.
I'vefoundthatwhenyouwanttocategorizesomethingaswe'redoinginthiscasepickingbetweendifferenttypesofflourinsteadofpredicting a valuelike a houseprice, thenusingthislostfunctioninsteadofsomethinglikerootmeanssquareworksmuchbetter.
Tokeeptrackofitsprogress, Weactuallygot a callbackcalledonEpochEnd.
Inthis, wecanprintourcurrentlostvalueonWhen I runit, you'llseethisvaluediminishepochbyepoch.
It's really a simpleisthatfortrainingonwhenwe'redone, we'llhave a modelthatcanclassifytheinputdata.
Solet's nowtake a lookatusingthemodeltodo a prediction.
We'veonlytrainedthismodelfor a littletime, only 40 pox, sowemayhavesomeerrorsandwe'llseehowtofixthatlaterSohere I'vecreated a tensorwith a bunchofinputvaluesthatmatchthoseofoneoftheitemsintherealdatawillpassthismodeltoget a predictionbackon.