Google Colaboratoryã便å©ã»é«éã§åéãã
Googleãç 究ã®ä¸ç°ã§æä¾ãã¦ããColaboratoryã試ãã¦ã¿ã¾ããã
Jupyterã¨åããããªGUIã§Pythonã®ããã°ã©ã ãå®è¡å¯è½ã§ãGPUã使ãã¾ãã
Jupyterã¨åæ§ã«ãå é ã«ã!ããæ¸ããã¨ã§ãLinuxã®ã³ãã³ããå®è¡å¯è½ã§ãããã!pipãã!condaãã!apt-getããªã©ã§æ©è½ã追å ã§ãã¾ãã
å®è¡çµæããã¡ã¤ã«ã·ã¹ãã ä¸ã«ä¿ç®¡ã§ããå
±æãªã³ã¯ã使ã£ã¦åãåºãã¾ãã
ãã ãã12æéçµéããã¨å¼·å¶çµäºããã¦ããã¡ã¤ã«ã¯å¤±ããã¾ãã
ããããNotebookãåãã¦ããä»®æ³ãã·ã³ã«Googleãã©ã¤ãããã¦ã³ãå¯è½ã§ãããããã«ãããå®è¡çµæãGoogleãã©ã¤ãä¸ã®ãã¡ã¤ã«ã¨ãã¦ä¿ç®¡ã§ãã¾ãã
Deep Learningã§ã¯ãéä¸ã®ç¶æ ããã¡ã¤ã«ã«ä¿ç®¡ãã¦ãããããResumeã§ããããã«ããã°ã©ã ãæ¸ããã¨ãå¤ãã®ã§ã12æéã§ä¸åº¦å¼·å¶çµäºãã¦ããGoogleãã©ã¤ãã«ä¿ç®¡ãããã¡ã¤ã«ã使ã£ã¦å¦ç¿ãåéå¯è½ã§ãã
試ãã«ãWide Residual Networks(WRN)ã®ã³ã¼ããå®è¡ãã¦ã¿ã¾ããããã®ã³ã¼ãã¯ã2016å¹´æç¹ã«CIFAR10ã§æé«æ§è½ãåºããã³ã¼ãã§ããColaboratoryã使ã£ã¦ã16æéç¨åº¦(éä¸ã§ä¸åº¦å¼·å¶çµäºããããããåé)ã§çµæãåºããã¨ãã§ãã¾ããããªããå½æ¹ã®PCã§ã¯GPUã¡ã¢ãªã足ããåãè¨å®ã§ã¯è©¦ãã¾ããã§ãã(2GBã§ã¯è¶³ããªãã£ã)ãå°ãåé¡ãµã¤ãºãå°ãããã¦(depth=16ããdepth=10ã«ãã)試ããã¨ãããColaboratoryã®æ¹ãåé¡ãµã¤ãºã大ããã«ãããããããEpochå½ããå¦çæéã¯çãã£ãã§ã(å½æ¹PC: 3å53ç§ãColaboratory:3å37ç§)ã
Deep Learningãå人çã«è©¦ãã«ã¯æé©ã¨æãã¾ããã
ä¸çæé«ã¬ãã«ã®ã³ã¼ãããããªç°¡åã»é«éã«è©¦ãããªãã¦ãåéãã¾ãï¼
Wide Residual Networks試è¡ç¨Notebook
ä¸è¨ãWRN試è¡ç°å¢ã¨ãã¦ä½ã£ãColaboratoryã®Noteookã§ããå ±æè¨å®ãã¦ãã¾ãã®ã§ããªã³ã¯ããã©ãã°ãç°¡åã«Colaboratoryã§å®è¡ã§ããã¯ãã§ãã
WRNd16w10(pytorch-v0.4).ipynb
Wide Residual Networksã®pytorch0.4対å¿ã«ããä¸é¨å¤æ´ããç(2018/9/30)ã
https://colab.research.google.com/drive/1fDdGmFhh7X2Tu_Cg9yoDSY-9bM78w41s
Notebookã«ã¯Wide Residual Networksã®Pythonã³ã¼ãã¯å ¨ãæ¸ããããgit cloneãã§ã³ã¼ããåå¾ãããimport mainãã§ã¡ã¤ã³ã®Pythonãã¡ã¤ã«ãmain.pyããã¤ã³ãã¼ããããmain()ããç´æ¥å¼ã³åºããã¨ã§å®è¡ãã¦ãã¾ãã
ãã ãããã®ã¾ã¾ã§ã¯ããã°ã©ã ã«å¼æ°ã渡ããªãã®ã§ãä¸è¨ã®ããã«ãéæ¥çã«ãmain()ãã«å¼æ°ã渡ãããã«ãã¦ãã¾ãããã®æ¹æ³ã¯æ±ç¨æ§ãããã®ã§ãä»ã®ã³ã¼ãã試ãéãæ´»ç¨ã§ãããã§ãã
import sys new_argv = "main.py --save ./logs/resnet_20180204 --depth 16 --width 10 --ngpu 1 --gpu_id 0".split(" ") sys.argv = new_argv main()
ä¸è¨ã¯ãå¦ç¿ç¶æ³ãå¯è¦åããããã®Notebookã§ãã
visualize.ipynb
https://drive.google.com/file/d/1eq4wAkZijRmfxiaQLpy5nXsR6I9Tu89-/view?usp=sharing
WRNã®ã³ã¼ããä½æãããã°ãã¡ã¤ã«ãlog.txtããGoogleãã©ã¤ãã§å³ã¯ãªãã¯ãã¦å ±æãªã³ã¯ãåå¾ããå¾ãä¸è¨Notebookã«å ±æãªã³ã¯ä¸IDãåãè¾¼ãã§å®è¡ããã¨ãå é ã§ç¤ºããããã«ãå¦ç¿ç¶æ³ãå¯è¦åã§ãã¾ãã
ä¸è¨ã³ã¼ãã¯ãWRNã®ã³ã¼ãã«å«ã¾ãã¦ãããã®ãæµç¨ããå¯è¦åã«Bokehã使ã£ã¦ãã¾ãããªããColaboratoryã®Notebookã§Bokehã使ãéã¯ãã°ã©ãã表示ããã»ã«å ã§ãoutput_notebook()ããå¿ ãå®è¡ããå¿ è¦ãããã¾ãããããåããããæåã¯Matplotlibã§è¡¨ç¤ºãã¦ãã¾ããããBokehã¯ã表示ããå¾ã§é¨åçã«æ¡å¤§ãããã§ããã®ã§ä¾¿å©ã§ãã