欢迎来到天天文库
浏览记录
ID:38925596
大小:2.78 MB
页数:7页
时间:2019-06-21
《Transfer Learning using PyTorch — Part 2 – Vishnu Subramanian – Medium英文学习资料》由会员上传分享,免费在线阅读,更多相关内容在学术论文-天天文库。
1、VishnuSubramanianFollowingLifelonglearner.Passionateaboutdeeplearning,distributedcomputing.Apr19·5minreadTransferLearningusingPyTorch—Part2InthepreviousblogwediscussedhowNeuralnetworksusetransferlearningforvariouscomputervisiontasks.Inthisblogwewilllookintothefollowing
2、.1.VGGArchitecture2.FinetuneVGGusingpre-convolutedfeatures3.Accuracy4.PerformancecomparisonbetweenPyTorchandKerasonTensorflowVGGArchitecture:OneofthemoststudiedDeeplearningmodelsfortransferlearningisVGG.WewillgothroughahighleveloverviewofVGGtounderstandhowitcanbeoptimal
3、lyusedintransferlearning.VGGmodelcanbesplitintotwokindsoflogicalblocks1.Convolutionblocks:Thepre-trainedVGGmodelistrainedonImagenetdatasetover1000categories.Theconvolutionalblockcontainsmultipleconvolutionlayers.Theinitiallayerscontainlowlevelfeatureslikelines,curves.T
4、helastconvolutionallayersinthisblockcontainmorecomplexkindoffeaturesofimageslikehand,leg,eyesandmanymore.Thebelowimagecaptureswhatkindoffeaturesarecapturedindifferentlayers.Asyoucanseefromtheaboveimages,thefeaturesbeingcapturedbytheconvolutionlayersofapre-trainedmodelca
5、nbeusedacrossmostkindofimageproblems.Theabovefeaturesmaynotworkforproblemslikecartoonanimations,medicalimagessincetheyneedcompletelydifferentfeatures.Theconvolutionlayersexhibit2importantproperties-1.Thenumberofparametersrequiredisfarlesscomparedtofullyconnectedlayer.Fo
6、rexampleaConvolutionlayerwith3*3*64sizefiltersneedonly576parameters.2.Convolutionlayersarecomputationallyexpensiveandtakelongertocomputetheoutput.2.FullyConnectedBlock:ThisblockcontainsDense(inKeras)/Linear(inPyTorch)layerswithdropouts.ThenumberofparameterstolearninFCla
7、yersarehugebuttakeswaylesstimetocompute.So,wegenerallyenduptakingpreconvolutedfeaturesfromConvolutionblockofVGGmodelasitisandtrainingonlythelastfewlayersoftheVGGmodelwhicharegenerallyfromfullyconnectedblock.FinetuneVGGusingpreconvolutedfeatures:Asweknowthatconvolutionl
8、ayersareexpensivetocalculate,itmakessensetocomputetheoutputoftheconvolutionlayersonceandusethemtotrainthefullyconnect
此文档下载收益归作者所有