VAE(Variational Auto Encoder)ã§ç«ã復å ã§ããªãã£ã話
ã¯ããã«
couseraã§Bayesian Methods for Machine Learningãåãã¦ãããã§ããã ãã®ä¸ã§åºã¦ããVAE(Variational Auto Encoder)ã§å°ã試ãã¦ã¿ãããã¨ããã£ãã®ã§ãã®å®é¨è¨é²ã«ãªãã¾ãã
åèæç®
VAEã®çè«ãä½ç½®ä»ãã«ã¤ãã¦ã¯ä¸è¨è³æãåèã«ãªãã¾ãã
VAEã«ã¤ãã¦
VAEã¯ä¸å³ã®ãããªæ§é ããã¤ã¢ãã«ã§ã å ¥åç»åã®ç¹å¾´éãEncoderã«ãã£ã¦ä½æ¬¡å ã®æ½å¨å¤æ°ã«æ¼ãè¾¼ãããã®æ½å¨å¤æ°ãç¨ãã¦å ã®ç»åã復å ããã¨ããã¢ãã«ã«ãªãã¾ããä½æ¬¡å åãããæ½å¨å¤æ°ã§ã¯å ¥åç»åã®å¾©å ãããã®ã«éè¦ãªç¹å¾´éã®ã¿ãæ½åºã§ããããã次å åæ¸ããã¤ãºé¤å»ã«å©ç¨ããã¾ããã¾ãå ¥åã¨åºåã®èª¤å·®ãç¨ãã¦ç°å¸¸æ¤ç¥ã«ãå©ç¨ã§ãã¾ãã
ãã®æ§é ã¯Auto encoderã¨åããªã®ã§ãããVAEã¯ãã®æ½å¨å¤æ°ã®é¨åã確çåå¸ã¨ãã¦ããç¹ãç¹å¾´ã«ãªãã¾ãã æ½å¨å¤æ°ã確çåå¸ã¨ããã¡ãªããã¨ãã¦ã¯ããã¤ãºé ãããããåãå ¥åã§ãç°ãªãåºåã¨ãªãå ¨ãæ°ããåºåãçæã§ãããã¨ãæ½å¨å¤æ°ãé£ç¶çãªåå¸ã§ããããã«ãä¾ãã°ããç¹å¾´ããã¤åºåãçæããããã«æ½å¨å¤æ°ã調æ´ã§ãããã¨ããæªç¥ã®å ¥åã«å¯¾ããæåãæ ä¿ã§ããç¹ãæãããã¾ãã
å®é¨
kaggleã®Dogs vs. Catsã®ãã¼ã¿ã使ã£ã¦ç«ç»åã ããå¦ç¿ãããç«ä»¥å¤ã®ç»åãç°å¸¸ã¨æ¤ç¥ãããããªã¢ãã«ã®ä½æãç®æãã¾ãã
VAE+CNNã®å®è£ ãkerasã®å ¬å¼ã«ããã®ã§ããããã¼ã¹ã«ãã¾ãã
ä¸è¨ã®ãªã³ã¯ã®ãã®ããå ¥åºåãCNNã®å±¤ã®æ°ãªã©ãä»åã®ãã¼ã¿ã«åãããããã«å°ãå¤æ´ãã¾ããã ãããã¯ã¼ã¯ã¯å段ã®CNNã§æ§æããæ½å¨å¤æ°ã®æ°ã¯256ã¨ãã¾ããã ãµã³ãã«ãµã¤ãºã¯trainãã¼ã¿ã¯8000ãvalidãã¼ã¿ã¯2000ã§ãã å®é¨ç°å¢ã¯google colaboratoryã§ãã
ä½æããEncoderã®ãããã¯ã¼ã¯ã¯ä»¥ä¸ã«ãªãã¾ãã
Decoderã®ãããã¯ã¼ã¯ã¯ä»¥ä¸ã«ãªãã¾ãã
ããã§ã¯ã³ã¼ãã¯å²æãã¾ããã使ç¨ãããã®ã¯ãã¡ãã«ãªãã¾ãã
ããç¨åº¦å¦ç¿ã§ãããããªã®ã§ããã®ã¢ãã«ã®ç²¾åº¦ã確èªããããã«ããã¤ãå ¥åç»åã¨åºåç»åãè¦æ¯ã¹ã¦ã¿ã¾ãã å·¦ãå ¥åãå³ãåºåã«ãªãã¾ãã
ãã¾ã復å ããã¾ãã§ãã¦ãã¾ããã輪éããã£ãããããç¨åº¦ã§ãã 精度ã®åé¡ãã¨æã£ã¦ãããã¯ã¼ã¯ã®å±¤ã®æ°ããã©ã¡ã¼ã¿ãæ½å¨å¤æ°ã®æ°ã®å¤æ´ãç»åã®ã°ã¬ã¼ã¹ã±ã¼ã«åãªã©ã試ãã¦ã¿ã¾ãããçµæã«å¤§ããªå¤åã¯ã¿ããã¾ããã§ãããreconstruction errorã§ç¬ç»åã¨ã®å·®ãè¦ããã¨æã£ã¦ããã®ã§ããããã以åã®åé¡ã§ããã
ãã®åå ã¨ãã¦ã¯ãå¦ç¿ç»åã«ããã°ãã¤ãã大ããããã®ãåå ãã¨èãã¦ãã¾ãã ãããµã³ãã«ã¨ãã¦ä½¿ãããmnistãé¡ç»åã®ãã¼ã¿ã»ããã¯ç»åã®ã©ã®é¨åã«ãªã«ãããããæ¯è¼çæ確ã§ãç»åæ¯ã®ã°ãã¤ããå°ãããã¼ã¿ã»ããã ã¨æãã¾ãããããã¨æ¯è¼ããã¨ä»åå ¥åã¨ãã¦ç¨ããç»åã¯ç«ã®ãµã¤ãºãä½ç½®ãåããèæ¯ãç«ç¨®ãªã©åãç«ã§ãå ¥åç»åæ¯ã®éãã大ãããæ½å¨å¤æ°ã®å°ãªããã©ã¡ã¼ã¿ã§ã¯ç»åã®ç¹å¾´ã表ãåããã¨ãã§ããªãã£ãã®ããªã¨æãã¾ããã (ã¨ã¯ããNNã¯ãã¾ãå¾æã§ãªãã®ã§ããããã£ããã§ããã®ããããã¾ãããâ¦)
ã¾ã¨ã
VAEã§ç«ç»åã ããå¦ç¿ãããç°å¸¸æ¤ç¥ã®ã¢ãã«ã¯ä½ããªãã£ã
VAEãæ£ãã使ç¨ããéã«ã¯ãããã¯ã¼ã¯ã®ãã¥ã¼ãã³ã°ãå ¥åç»åã®é¸å®ãå¿ è¦ã ã¨æãã