Generativeadversarialnetworks(GANs)areoneofthehottesttopicsindeeplearning.Fromahighlevel,GANsarecomposedoftwocomponents,ageneratorandadiscriminator.Thediscriminatorhasthetaskofdeterminingwhetheragivenimagelooksnatural(ie,isanimagefromthedataset)orlookslikeithasbeenartificiallycreated.Thetaskofthegeneratoristocreatenaturallookingimagesthataresimilartotheoriginaldatadistribution,imagesthatlooknaturalenoughtofoolthediscriminatornetwork.
Theanalogyusedinthepaperisthatthegenerativemodelislike“ateamofcounterfeiters,tryingtoproduceandusefakecurrency”whilethediscriminativemodelislike“thepolice,tryingtodetectthecounterfeitcurrency”.Thegeneratoristryingtofoolthediscriminatorwhilethediscriminatoristryingtonotgetfooledbythegenerator.
Asthemodelstrainthroughalternatingoptimization,bothmethodsareimproveduntilapointwherethe“counterfeitsareindistinguishablefromthegenuinearticles”.
ThetutorialiswritteninPython,withtheTensorflowlibrary,soitwouldbegoodtohavefamiliaritywithTensorflowbeforetakingalookatthistutorial.
HowtoUseJupyterNotebooksFirststepisalwaystoclonetherepository.gitclonehttps://github.com/uclaacmai/Generative-Adversarial-Network-Tutorial.gitNext,wewanttomakesurewehaveJupyterNotebookinstalled.Youcaneitherfollowoneoftwopaths.YoucaneitherinstallAnaconda(whichinstallsPython,JupyterNotebook,andabunchofotherusefulcomputinglibraries)orusepip.ToinstallAnaconda,takealookattheirwebsite,whichhassomeprettygreatdocumentation.
Ifyouwanttoinstallusingpip,you'llneedtoupdatepipwiththefollowingcode(Replacepipwithpip3ifusingPython3).
OnLinux/MacOS:
pipinstall-UpipsetuptoolsOnWindows:
python-mpipinstall-UpipsetuptoolsNext,youshouldbeabletorunthefollowing.
pipinstalljupyterFinally,runthefollowingcommandandanewtabinyourbrowserwiththeJupyterNotebookshouldcomeupjupyternotebookFormoreresourcesonJupyterNotebooks,checkoutthefollowing:
InstallationDocumentationTryingJupyterjustinyourbrowserJupyterDocsVideotutorialonJupyterDetailedtutorialsonusingdifferentPythonlibrariesinJupyterNotebooksMoreGANResourcesTheoriginalpaperwrittenbyIanGoodfellowin2014.SirajRaval'svideotutorialonGANs(Reallyfunvideo)IanGodfellow'skeynoteonGANs(Moreofatechnicalvideo)BrandonAmos'simagecompletionblogpostBlogpostonusingGANsinvideogames.AndrejKarpathy'sblogpostwithGANvisualizations.AditDeshpande'sblogpostonGANsandoverviewofsomeassociatedpapers.
评论