ChatGPTã¯Kaggleã§ã©ã使ãããï¼
çããããã«ã¡ã¯
ãå
æ°ã§ããããï¼å¿å¹´ä¼ã·ã¼ãºã³ã§ç²ãæã¦ã¦ãããã1æ¥é
å»ãã¾ããã
ãã®1å¹´ãçæAIã®ãã¼ã ãæ¥ã¦ãããKagglerã®çæ§ãChatGPTã使ã£ã¦ããæ¹ãå¤ãã®ã§ã¯ãªããã¨æ¨æ¸¬ãã¦ãã¾ãã
ã¨ãããã¨ã§ãæ¬æ¥ã¯ç§ã®ä½¿ãæ¹ãç°¡åã«ç´¹ä»ãããã¨æãã¾ãã
ã³ã³ãã®ä½¿ãæ¹
ChatGPTããã¾ãå©ç¨ããã¨çç£æ§ã®åä¸ãè¦è¾¼ãã¾ãã
åé¢ããã«ã·ãã¼ã·ã§ã³ãçã¿åºãã®ã§ã使ãæ¹ã誤ãã¨è´å½çã§ãã
ãã®ãããåºåãä¿¡ãããåºæ¬ã¯ãã§ãã¯ãã§ãããã®ã«ãã¦ããã®ãè¯ãã§ãããã
å ·ä½çãªå©ç¨å 容
ã³ã³ãç解
説ææã®ç解
å°éã馴æã¿ã®ãªããã®ã«é¢ãã¦ã¯ãæ£ç´ã説ææãç解ããã®ã大å¤ã§ãã
ãã®æã«ã¯ChatGPTã«èª¬æãã¦ãããäºãå¯è½ã§ãã
ãã¼ã¿ã®ç解
ãã¼ã¿ã®å
容ãå°éåéã§ããã°æ£ç´ããããªããã¨ãå¤ãã§ãã
ãã®ããããã¼ã¿ã®å
容ã説æãã¦ãããã¾ããããããããªããã¨ãå¤ãã®ã§ãã®æã¯è¿ä¿¡ã§æ´ã«è³ªåãã¦ç解ãæ·±ãã¾ãããã
å®è£
å®è£ ãã¦ããã
èªåã§å®è£
ã¨æ
£ãã¦ããããé£ãããã®ãããã¾ãã
ãã®å ´åãChatGPTã«å
¥åãã¦ãå®è£
ãã¦ãããã®ãæã¾ããã§ãããã
ãã¹ãããã§ããã°ãå
¥åºåã«ãã£ã¦æ£ããã確èªã§ããã®ã§ããã®ãããªãã¹ããæ¸ãã¤ã¤ãä½ããã¨ã§ãã°ãé²ãã¾ãã
å®è£ ã®å¤æ
å®è£
ã«æ
£ãã¦ããªãã³ã¼ããæ¸ãã®ã¯ã¤ããã§ãã
ä¾ãã°ãæ®æ®µPyTorchã®å®è£
ãæ¸ãã¦ãã人ã«Kerasã®å®è£
ãæ¸ãã®ã¯ã¨ã¦ãè¾ãã§ãã
ãã®æã«ã¯ChatGPTã«å¤æããã¾ãããã
Kaggleã§ã¯ããã®ç¨æãªã¦ã¼ã¹ã±ã¼ã¹ã¯tensorflow liteã«å¤æããã¨ãã«ä½¿ãã¾ãã
ã¾ããCythonã«ããå®è£ ãå¯è½ãªã®ã§ãPythonã§ããã©ã¼ãã³ã¹ãåºããããªãã¨ãã«ã¯é常ã«ä¾¿å©ã§ãã
ãããã°
æã
ããã°ã®è¦å ãããããããªããã¨ãããã®ã§ã
é¢é£ãã¦ããã¨æãããå®è£
ã¨ä¾å¤ã®ã¡ãã»ã¼ã¸ãå
¥åããã¨æã
æ£ããåçãè¿ã£ã¦æ¥ã¾ãã
ãã®ä»
翻訳
ã½ãªã¥ã¼ã·ã§ã³æ¸ãã¨ãã¯è±èªã«ããå¿
è¦ãããã¾ããã
æ®å¿µãªãããè±èªãã¤ãã£ãã§ã¯ãªãã®ã§ãè±èªã§æ¸ãã®ãé常ã«é£ãããä¼ããè±èªã«ãªã£ã¦ãããæªããã§ãã
ãã®ãããChatGPTã«ç¿»è¨³ã¨ä¿®æ£ããã¦ãããã¾ãã
æå¾ã«
ChatGPTãå¢ãããã¨ã«ãã£ã¦é£ããå®è£
ãChatGPTã«ä»»ããã¨ãã£ããã¨ãã§ããããã«ãªãã¾ããã
æ¥å¹´ä»¥éã¯ãã®æµããå éããã®ã§ãæ´ã«è²ããªãã¨ãã§ããããããã¾ãããã
AIã§ä½ã£ãç»åãAIã¯è¦åããããã®ãï¼ï¼
çããããã«ã¡ã¯
tereka114ã§ããæè¿ã¯NLPé¢ä¿ã®æè¡èª¿æ»ãå
¼ãã¦ãFB3ããã£ã¦ã¾ãã
æè¿ã®ç¤¾ä¼ã®æµããè¦ã¦ãã¦ãå°ãæéã®çé
ã§ãã£ã¦ã¿ããäºãã§ãããã£ãã®ã§ãå®é¨ã¨ãã®çµæãæ¸ãã¦ããã¾ãã
å°å ¥
ä»å¹´ã¯Stable Diffusionãçºè¡¨ãããã¾ããmimicãNovelAIãªã©ç»åã®çæã«é¢ãã¦
社ä¼ã«åçãªã¤ã³ãã¯ããä¸ããã¢ãã«ï¼ãµã¼ãã¹ãçºè¡¨ããã¦ãã¾ããã
ä»ã¾ã§ã®çæã¢ãã«ããããªãã«ããã£ã¨è¨ããã¦ã¾ããããããã¾ã§ã¤ã³ãã¯ããä¸éçã«åºã¦ãããã¨ã¯ã»ã¨ãã©ãªãã£ãã®ã§ã¯ãªããã¨æã£ã¦ãã¾ãã
ç§ããä»äºã§ãã¾ãé¢ä¿ãããªãé½åä¸ãGAN以éã®ã¢ãã«ã¯ãã¼ãã¼ã¯ã ã£ãã®ã§ãé常ã«é©ãã¾ãããï¼è¨æ¶ã ã¨BigGANãæå¾ã»ã»ã»ï¼
ç§ãGANã使ã£ã¦ããé ã¯32px, 64pxãçæããã®ãé度ã§ããã¤ããããã§ã¯ããã¾ããã§ããã
ãããããããæ°å¹´ï¼5å¹´ã»ã©ã ã¨æãã¾ããã»ã»ã»ï¼ãããªã«ç¶ºéºãªç»åãçæã§ããã¨ã¯æã£ã¦ãã¾ããã§ããã
ãã¡ãããæ©æ¢°å¦ç¿ã¨ã³ã¸ãã¢ã¨ãã¦ãAIãããã大æè¿ã¨ãã£ãæ¬äººä¸»è¦³ã®ä¸é¢ã ãã§è¦ãè³æ¥µåç´ãªææ³ãããã¾ããã
ãã¶ã¤ãã¼ï¼ã¤ã©ã¹ãã¬ã¼ã¿ã¼ããããããã¨ããã¯ãé©ç°ã®ä¸ã¤ã§ãããæ¢åã®çµµã¨è¿ãããã®ãåºã¦ãããã¨ãã£ããã¨ã«ãªãã°ã
AIã«ããçµµã®ãã¯ãªãªã©ãæ°ããåé¡ãçã¾ããã®ã¯å½ç¶ã®ãã¨ã§ãã
ãã®ãããªã®ãããµã¼ãã¹ã®è¦ç´ã§AIã®ç»åãã¢ãããã¼ããé»æ¢ãã¦ããã¨ãã£ãæ å ±ãã¡ãã»ãTwitterã§è¦ããã¦ãã¾ãã
ãããã®AIãçæããç»åã®æ¨©å©ã»å«çé¢ä¿ã®è¯ãæªããå®æ
ã®æ£èª¤ã¯ã¨ãããã¨ãã¦ã
人é¡ãä½ã£ãç»åAIãä½ã£ããã¼ã¿ãè¦åããã®ã¯å°æ¥çã«ä¾¡å¤ããããã®ã ã¨æã£ã¦ãã¾ãã
段ã
ã¨é£ãããªã£ã¦ããã¨æãã¾ãããä»ã®æ®µéã ã¨ã©ããªã®ããè¦ã¦ã¿ããã¨ã¯æå³ãããããã§ãã
æºå
ç»åå´ã®ãã¼ã¿ã»ããã¯ã»ã¼ãã¦ã³ãã¼ãããã ãã§ãã
Stable Diffusionã®ã»ããã¢ãã
ç§ã¯ãã®ãªã³ã¯ã®docker/docker-composeãå©ç¨ãã¦ãç°å¢ãæ§ç¯ãã¾ããã
注æããªããã°ãªããªãã®ã¯git-lfsãå
¥ãã¦ãããªãã¨ãhugging faceããã®ã¢ãã«ãã¦ã³ãã¼ãæã«å®ä½ãè½ã¡ã¦ããªãããããããã¾ãã
zenn.dev
次ã®ã³ãã³ããå®è¡ããã°ãgit-lfsããã¦ã³ãã¼ãã§ãã¾ãã
sudo apt install git-lfs
å®é¨
å®é¨ç®ç
æ¬è¨äºã§ã¯AIãä½ã£ãã®ãå¦ããè¦åãããã¨ãç®çã§ãã
å©ç¨ç¨éãéã¿ã¦æ¬¡ã®2ã¤ã調æ»ããå¿
è¦ãããã¾ãã
- åããã¡ã¤ã³ã§è¦åããããã®ããä¾ãã°ãã©ã³ããã¼ã¯ãå¦ç¿ããã¦ãæ°ããã©ã³ããã¼ã¯ãè¦ã¤ãã£ãã¨ãã«ããã®ã©ã³ããã¼ã¯ãæ£ããå¤å®ã§ããã®ãã
- éããã¡ã¤ã³ã§ãè¦åããããã®ããä¾ãã°ãã©ã³ããã¼ã¯ãå¦ç¿ããã¦ãè»ãå¤å®ããå ´åããã®è»ã¯æ£ããå¤å®ã§ããã®ãã
ãã¼ã¿ä½æ
Stable Diffusionã¨äººå·¥ã®ãã¼ã¿ãæºåããåç´ã«äººé¡ï¼AIã§2å¤åé¡ãã¾ãã
ä¸ã¤ã®ã«ãã´ãªã ã¨é£ãããã®ããããããããªãã®ã§ãããã¤ãã®ããã³ããï¼åªæï¼ã§è©¦ãã¾ããã
Category | Real Dataset | SD Prompt |
---|---|---|
Landmark | GLDv1 | landmark |
Car | myautage | car outside |
ãªã¢ã«ç»åã¨çæãããç»åã§ããã©ãã§ãããï¼ãããã¾ãã§ããããï¼
Landmark Original
Stable Diffusion Landmark
Car Original
Stable Diffusion Car
ã¢ãã«ä½æ
ã¢ãã«ã¯EfficientNetV2mï¼Pretrained ImageNetï¼ã§åå¦çã次ã®2ã¤ã®ãã¿ã³ã試ãã¾ããã
Resize/RandomCropï¼å¦ç¿ï¼+Resize/CenterCropï¼æ¨è«ï¼ãç¨ãã¾ãããResizeã ã¨ç»åã«å å·¥ãå
¥ãã®ã§ãç¹å¾´çãªãã¤ãºãå«ã¾ããå ´åããã®ãã¤ãºãå¤ãªæ¹åã«ä¿®æ£ããããã¯ãæ¶ããå¯è½æ§ãããã¾ãã
ãã®ãããCropç³»ã®ã§ããã°ããã®ãã¤ãºãå å·¥ããåãè¾¼ãããã¨ãæå¾
ãã¾ãã
è©ä¾¡æ¹æ³
AUCãF1ãRecallãPrecisionãè¨ç®ãã¾ãã
å®é¨çµæ
æ¡ä»¶ | åå¦ç | AUC | F1 | Recall | Precision |
---|---|---|---|---|---|
Landmark | Resize | 0.998 | 0.982 | 0.996 | 0.969 |
Car | Resize | 0.975 | 0.582 | 0.412 | 0.994 |
Landmark | Crop | 0.999 | 0.999 | 1.0 | 0.999 |
Car | Crop | 0.999 | 0.998 | 0.999 | 0.997 |
å®è£
ã®è©³ç´°ã¯æ¬¡ã®Kaggle Notebookãè¦ã¦ãã ããã
Crop
https://www.kaggle.com/code/tereka/detectstablediffusionimages?scriptVersionId=109399786
Resize
https://www.kaggle.com/code/tereka/detectstablediffusionimages?scriptVersionId=109300787
Cropã®ã»ãã精度ãé«ãã£ãã§ãã
ãªãµã¤ãºã¯å
ç»åã®è§£å度ã«ãã£ã¦ã縮å°ã®ããæ¹ãç°ãªãã®ã§ãå¤å®ãé£ããã£ãã®ã§ã¯ãªããã¨æ¨æ¸¬ã§ãã¾ãã
Future Work
ããæ®ãããã¨ã¨ãã¦ã次ãããã¾ãã
- æ§ã ãªã¢ãã«ã使ã£ã¦ã®æ¤åºãStable Diffusionã®ã¿ãªãããä»ã®ã¢ãã«ã使ã£ã¦è©¦ã¿ã¦ã©ã®ã¢ãã«ããå½ã¦ãã
- ããç°ãªããã¡ã¤ã³ã®éãã«ããå·®åã¯ããããä¾ãã°ãã¢ãã¡ç»åï¼Waifu diffusionãªã©ï¼ã§ããã°ãã©ã®ããã«ãªãã®ãã
- 解å度ã®æ¯è¼ãStable Diffusionã®è§£å度ãåºå®ã ã£ãããæ§ã ãªè§£å度ã®ç»åãå«ã¾ããå ´åã«ã©ããªãã®ãã
æå¾ã«
ä»åã®ãã¼ã¿ã»ããã§ã¯AIãè¦åãããã¨ãã§ããã®ã§ãçæãããç»åã«ä½ããã®ç¹å¾´ããã£ãã®ã§ã¯ã¨æã£ã¦ãã¾ãã
AIã§AIã§ä½ã£ãç»åãããããï¼ã¨ãã£ããã¨ã ãã§AIã«ãã諸åé¡ãå
¨ã¦è§£æ±ºããã¨ã¯ãã¡ããè¨ãã¾ããããåé¡ã®è§£æ±ºã«ä¸å½¹è²·ã£ã¦ãããã¨ãããããã¨èãã¦ãã¾ãã
Kaggle Grandmasterã«ãªãã¾ã§ã®7å¹´éã®è»è·¡
çããããã«ã¡ã¯
ãå
æ°ã§ãããããå¬ã ã¨ããã®ã«ãGPUã¨ææ¿ã§åè¢è£
åã§ãéããã¦ãã¾ãã
ä»å¹´ãé·ãã«ãããMasterçæ´»ã®çµæ¼ãè¿ããããããGrandmasterã«ãªããã¨ãã§ãã¾ããã
ããã§ãGrandmasterã«ãªãã¾ã§ã®çµé¨ããã¡ãã«æ¸ãè¨ãã¦ãããã¨æãã¾ãã
ãã®è¨äºã¯Kaggle AdventCalendar2021ã«ã¬ã³ãã¼2ã25æ¥ç®ã«ãªãã¾ãã
- èè ã®èæ¯
- Kaggleã¸ã®åãçµã¿
- Kaggleã«åãçµãã§æã£ããã¨
- ä»å¾ã®ææ¦
- æå¾ã«
èè ã®èæ¯
M2ï¼æ å ±ç³»ï¼ã®ã¨ãã«Kaggleãã¯ããã¾ãããï¼å¦é¨ã¯æç³»ã§ãï¼
å
輩ãç 究ã®ä¸ã¤ã®æ¤è¨¼ï¼éç¨ï¼ã§Kaggleã«ãµãããããã¦ããã®ãè¦ã¦ç¥ãã¾ããã
ãããããµã¨ããæ¥ãç¾å®éé¿ã§ãã¯ãããã®ããKaggleã§ç«¶äºãã¦ã¿ãã®ãé¢ç½ããã¨æã£ã¦åå ã試ã¿ã¾ããã
AutoEncoderãªã©æµè¡ã£ã¦ããé ã§ã¯ãã£ãã®ã§ãç 究ã§C++ãtheanoãæ¸ãã¦ãã¾ãããç 究åéã¨ãã¦ã¯ç»åã§ãã
ããããä»ã®ä¼ç¤¾ã«å°±è·ãã¦ããç¶ãã¦ãæ©7å¹´ã§ãã
æããç»åç³»ã®ã³ã³ããä¸å¿ã«åå ãã¦ãã¾ãããããã¼ãã«ãNLPãé¢ç½ããã§ããã°åå ãã¦ãã¾ãã
æ¦ç¸¾ã¯é6æãé21æãé
4æã¨ãã£ãã»ã¨ãã©éã§åãå°½ãããã¦ãããããã»ã¼ã·ã«ãã¼ã³ã¬ã¯ã¿ã¼åãã¦ããã¾ããéãå¤ãç²å¾ãããã§ãã
Masterã«ãªãã¾ã§4å¹´ãGrandmasterã«ãªãã¾ã§7å¹´ãããã£ã¦ãããä»ã®ç¾Grandmasterã®æ¹ã¨æ¯ã¹ã¦ãé常ã«é·æéããã£ãããã«æãã¾ãã
Kaggleã¸ã®åãçµã¿
1-3å¹´ç®
ãã®ãããã¯æ£ç´ã³ã³ããããããããªãã¨æããªããåå ãã¦ãã¾ããã
å½æã¯ãæè¬ã³ã³ããã£ã·ã§ã³ããã¼ã¿åæã®ç¥èã®é«ééè·¯ãå°ãªãã£ãã§ãã
ãã®ãããã½ãªã¥ã¼ã·ã§ã³ãèªãã§ãã©ããã¦ããããã£ãã®ããã決ã¾ãã®ãã¿ã¼ã³ã¯ããããããªããã®ãå¤ããè²ã
ã¨ææ¢ãã§é²ãã¦ããè¦ããããã¾ãã
ä»ã®ç»åãNLPãªã©ã®éæ§é ãã¼ã¿ãããå§åçã«æ§é åããã¦ãããã¼ãã«ãã¼ã¿ãå¤ãã£ãã§ãã
æ¯åEDAãããããã¾ãããä»ã®ããã«ä½ç³»ã ã£ããGroupbyã®AggregationãTargetEncoderã使ããããªç¹å¾´éã®ä½ãæ¹ããããããããé ãæ±ããªãããã©ã¤ãã¦ãã¾ããã
DLã®FWãå½æãä»ã»ã©PyTorchãKerasãããã«çµãã¦ããããã§ã¯ãªããtheano, lasagne, torch(lua)ãä¸å¿ã¨ãã¦ãè²ã
ãªã©ã¤ãã©ãªã«è§¦ãã¦ã¾ããã
ãªãã¨ãªãã§ãããKerasã¯äººæ°ããã¾ããã
ãã®æ代ã¯ç»åã®ã¢ãã«ã¯Pretrainedãç¦æ¢ããã¦ããå¾åã«ããã¾ããã®ã§ãã©ã³ãã åæå¤ããå¦ç¿ããã¦ã¾ããã
ãã°ãããã¦ããã®ã³ã³ãã¯ã¯ããã¦ãPretrainedã®å©ç¨ãOKã«ãªã£ãããã«è¨æ¶ãã¦ãã¾ããï¼ResNetåºãé ã§ããï¼
State Farm Distracted Driver Detection | Kaggle
ãã®ãããä»ã®ããã«Pretrainedãæèãããã¨ãªããã³ã³ãã®å ¬éNotebookãªã©ã«å¾ã£ã¦ãåèªä½¿ããããã©ã¤ãã©ãªã使ã£ã¦ããã®ã§ã¯ã¨æã£ã¦ãã¾ããï¼ç§ã¯ããã§ããï¼
â»ä»ã¯Kaggleæ¬ãã¯ããã¨ãã¦ãåå¿è ããã§ãå¦ã¹ããã®ãå¢ãã¦ãã¦ããã®ã¯è¯ãã¨ããã§ããã
4å¹´ç®
IEEE's Signal Processing Society
åçãæ®å½±ããã«ã¡ã©ãæ¨å®ããåé¡ã§ãã
åé¡è¨å®ã¨ãã¦ã¯é¢ç½ããç§ã®ç®ã§ç¢ºèªãã¦ãä½ããããã¾ããã§ããããæ©æ¢°çã«ã¯9å²ãè¶
ãã精度ãç²å¾ã§ãã¾ãã
ãã ãããã®ã³ã³ããã«ã¼ã«å´ã«ç©´ããããæå¾ãé¿é¼»å«åã§å¤§å¤ã ã£ãè¦ããããã¾ãã
ãã·ã¢ãã¼ã ã®å¤ããä¸ä½ã«ããã®ã§ãããExternal Dataããã¦ã³ãã¼ããã¦å©ç¨ããã¨ãã£ãæ¡ä»¶ãéå¶ãã«ã¼ã«ã«æ¸ãå¿ãã¦ãã¾ããã
ãã®çµæãã³ã³ãã®ç¹æ§ä¸ãYandexãFlickrãªã©ã®ãã¼ã¿ãããã¦ã³ãã¼ããã¦ãã¾ããã
EXIFããã§ãã¯ããã°çãããããã®ã§ãç»åããã¦ã³ãã¼ãããã¨ãã£ããã¨ã§ç²¾åº¦åä¸ãå¯è½ã¨ãã£ãç¶æ
ã§ããã
ããã«æ°ã¥ãã¦ããªãã£ããã¼ã ã¯è¦æ¦ãå¼·ãããã¾ããã
ï¼ãã·ã¢ã®ãã¼ã ãods.ai以å¤æ°ã¥ãã¦ããªãã£ãã®ã§ã¯â¥ï¼
ãã®ã³ã³ãã§æçµçã«ã¯ã®ãªã®ãªã§éã«åã¾ããæ´ãã¦Kaggle Masterã«ãªãã¾ããã
www.slideshare.net
åç»Verï¼Kaggle Meetup #4ï¼
www.youtube.com
Avito Demand Prediction Challenge
å人çã«é¢ç½ãã³ã³ãã§ããã
æè¿ã§ã¯ãã¾ããªãã®ã§ããããã¼ãã«ï¼ç»åï¼NLPã®ä¸ç¨®é¡ã®ãã¼ã¿ãæ±ããªããã°ãªããªããã®ã§ããã¥ã¼ã©ã«ãããã¯ã¼ã¯ã®ä½æããããããã¾ããã
éæ§é ååã ã¨æ®éãªã®ã§ãããã«å¤ãã®ãã¡ã¤ã³ãæ±ããã¨ãã£ãã¨ããã¯ããããããã¨æãã¾ãã
ç§ãéä¸CVPRã«è¡ããªããåå ãã¦ãããããæ¥æ¬ãã¢ã¡ãªã«ãã¨ã¼ãããã§24hä½å¶ã§ã³ã³ããã¦ãããã¨ãè¦ãã¦ãã¾ãã
ããªãé å¼µã£ãã®ã§ãããæå¾Shakedownãã¦éããå¼¾ããã¦ãã¾ã£ãã®ã¯ã¨ã¦ãæããã£ãã§ããåéä¸è¶³ã§ããã
Home Credit Default Risk
12人ã§ãã¼ã ãçµãã ææ
¨æ·±ãã³ã³ãã§ãã
å°ãªãã¨ãKaggleã§ã¯ããããã®äººæ°ã§ãã¼ã ãçµããã¨ã¯ãªãã§ãããã
ï¼ããããã£ããã§ãã¼ã ãã¼ã¸ããã®ãã¨ç¢ºã5人ã¾ã§ã«ãªã£ããããªã»ã»ï¼
ãã¼ã ãçµãã ããããã®ã¡ã³ããéãã¢ããã¼ãã«åãçµã¿ãè²ã
ã¨è°è«ãã§ããã®ã¯åå¼·ã«ãªãã¾ããã
ãã¼ã ãã¼ã¸å½æãæ¢ã«ãããããªãã®ãããå°½ãããã¦ããã®ã§ã¯â¥ã¨ã¾ã§æã£ã¦ããã®ã§ã趣åãåããã¦ãæ§ã
ãªã½ãªã¥ã¼ã·ã§ã³ã«åãçµã¿ã¾ããã
æå¾ã®ãªã®ãªã§2ä½ã®åè³éã«ãªã£ãã®ã¯ãªãã¨ãããã¾ãããè²´éãªçµé¨ã§ããã
ã½ãªã¥ã¼ã·ã§ã³ã®å³ã¯ä»ãæ¯ãè¿ã£ã¦ãåå ããä¸ã§ãæãè¤éãªå³é¢ã ã¨æãã¾ãã
5å¹´ç®ããã
ãªããªãææãåºãªãå¹´ã§ãã¾ãéã«å±ããªãã£ãã¨æããã¨ãå¤ãããã¾ããã
Google QAãHumpbackã¯éãçã£ã¦ãã¾ããããæå¾ã«è¿½ãæãããããã·ã§ã¤ã¯ãã¦ã³ãããã§ä¸æ©å±ãã¾ããã§ããã
ãã ãè² ããä¸ã§ãåã³ã³ãã§å¦ã¹ããã¨ã¯å¤ããä»æ¯ãè¿ãã¨ç¡é§ãªãã¨ã¯ãªãã£ããã ãªã¨æãã¾ããå½æã¯é æ±ãã¦ã¾ããã
ã©ã®ã³ã³ããã½ãªã¥ã¼ã·ã§ã³ãèªãã§ã»ãã®ããããªå·®ã§è¶³ããªãã£ããã®ã§ããã¨ä¸æ¯ã ã¨ãæãã¾ããããåæã«ããã§åã¦ãªãã®ãå®åãªã®ããªã¨æã£ã¦ãã¾ããã
6å¹´ç®
Global Wheat Detection
ã³ã³ãã§åãã¦çé¢ç®ã«è¡ãç©ä½æ¤åºã§ããã
é称ãå°éº¦ã³ã³ãã®é£ããã¨ããã¯ãä¸çåå½ã®å°éº¦ã®æ¤åºãå¿
è¦ã«ãªããå°æ¹ã«ãã£ã¦å°éº¦ã®ç©ãå¤ãã£ã¦ãã¾ãã
ä»åããã®ãã¡ã¤ã³ã®å·®åãã©ã®ããã«åããããã³ã³ããã£ã·ã§ã³ã®ä¸ã§é£ããã£ããã¤ã³ãã ã¨æãã¾ãã
åé¡è¨å®ã¨ãã¦ã¯é¢ç½ãã£ãã®ã§ããããã¼ã¿ãã¢ãã«ãªã©è²ã
åé¡ããããæå¾ã¾ã§ãã¤ãã¤ããããã¦ãã¾ããã
ç©ä½æ¤åºã§ä»ããªãå©ç¨ããã¦ããYoloV5ã®ã¢ãã«ãããã¾ããããã®ã¢ãã«ãGPL-3ã§ãããã¨ã«ãã使ã£ã¦ããã®ãæªãã®ãè°è«ãå¤ãããã¾ããã
DeepFakeã³ã³ãã¿ããã«çµãã£ã¦ããã©ã¤ã»ã³ã¹å¤±æ ¼ã«ãªããããªç¶æ
ã«ã¯ãªããããªãã®ã§ãã¢ãã«ããã¼ã¿ã®å©ç¨ã¯æ
éã«ãªããããå¾ã¾ããã§ããã
å¤æã®è³å¦ã¯ããã¨æãã¾ãããéå¶ãã¯ã£ããã¨Yes/Noåºãã¦ãããã®ãè¯ããã¤ã³ãããªã¨æãã¾ãã
ãã®ã³ã³ãã¯é常ã«ç²¾ç¥ãã¡ã¼ã¸ãé«ããPrivateå
¬éããã¦ãã
ãã¼ã¿ã®ã¢ããã¼ã·ã§ã³ä¿®æ£åã¨å¾ééã£ã¦ããã¾ãããç´ããã¿ãããªãã¨ãçºçãã¦ããã大å¤å¿èã«æªãã£ããã¨ãè¦ãã¦ãã¾ãã
ããæ¥èµ·ãããæ·±å¤ã«æ´æ°ããã¦ãããæ°ãã¤ãããéã«ãã¾ãããï¼æåã®å
¬éæã¯å¹ã£é£ãã§ã¾ããï¼
ããã§ã½ãéãåããã®ã¯ããããæ®ãã®ã¡ãã«ãéããä¸ã§ãä½ãæ°ã«ããå¿ è¦ããªããªã£ãç¹ã§é常ã«æ¥½ã§ããã
7å¹´ç®
Shopee - Price Match Guarantee
軽ãæ°æã¡ã§ECãµã¤ãã®ãã¼ã¿ã«èå³ããã解æãé©å½ãã£ã¦ãããä¸ä½ã«æ¥ã¦ãã¾ãã¾ããã
NLP+Imageã®ä¸¡æ¹ã®ãã¼ã¿ã解æããªãã¨ä¸ä½ã«å°éã§ããªããã¨ããããé常ã«é¢ç½ãã³ã³ãã ã£ãããã«è¨æ¶ãã¦ãã¾ãã
ãã®ãããããTransformeré¢é£ï¼Swin Transformerï¼ã®ã¢ãã«ãçå¨ã奮ã£ã¦ãããæ代ã®å¤åãæãã ããé åãã§ãã
Hungry Geese
åãã¦ææ¦ããå¼·åå¦ç¿ã®ã³ã³ããã£ã·ã§ã³ã§ãã
æ¥æ¬äººãå¤ãã£ãï¼HandyRLãã¼ã¹ã®å®è£
ãå
¬éããã¦ãããå¼·åå¦ç¿ã«ãã¡ãã¨ææ¦ããã«ã¯ãã£ã¦ããã¨ãã£ãç¶æ³ã§ããã
å¼·åå¦ç¿ã®åå¼·ããã¦ããã«ã¤ããã¢ãã«ãæ¢ç´¢ç³»ã®ã¢ã«ã´ãªãºã ãå¿
è¦ã«ãªãå³ããã£ããã¨ãè¦ãã¦ãã¾ãã
ãã®ãããªä¸ã§ãã¼ã ãçµã¾ãã¦ããã ããè°è«ãæ¹åã§ããã®ã¯é常ã«è²´éãªä½é¨ã§ããã
ã¡ãªã¿ã«è©ä¾¡æé2Wã®æãåºããªãæéã¯ãã©ããããæ¥å¤ã«ã丼ãé£ã¹ããåæ¥ã¯ç©çç¥ç¤¾ã«éããªã©ãã¦ãããç¥é ¼ã¿ã¹ã¿ã¤ã«ã§ä¹ãåãã¾ããã
æ®æ®µã¯éãã追æ¾ãããç§ã11ä½ã®ãªã®ãªã«æ®ãKaggle Grandmasterã«ãªãã¾ããã
Landmark Competitions
ã»ã¼æ¯å¹´åå ãã¦ããLandmark Competitonã§ããï¼2019ã¯è¨ç®ãªã½ã¼ã¹ã¯å¿
è¦ãããã®ã§è«¦ããï¼
2021å¹´ã¯Recognition/Retrievalã¨ãã«Notebookã§ãRetrievalã¯æ¨å¹´ã®è¬ã®TensorFlowç¸ãããªããªããç´ç²ã«é¢ç½ãã³ã³ããã£ã·ã§ã³ã«ãªãã¾ããã
éå»ã®ã³ã³ãã ã¨2018å¹´ã«GLDv1ã2019å¹´ãããã巨大ãªGLDv2ã2020å¹´ããNotebookã¨é²åãã¦ãã¾ããã
ã³ã³ãåºç¤ã«ãã¼ã ã«èªãããã®ã§ãã¼ã¸ãã¾ããã
å°ããã£ã¦ã¿ã¦æ³åéããè¨ç®ãªã½ã¼ã¹ã足ããªããã¨ã¯ã¯ããããããã£ã¦ããã®ã§ããã¼ã¸ãã¦å¹çããã¢ãã«ãä½ããã¨ãã¦ãã¾ããã
ãäºããTPUãå©ç¨ãã¦ãã¦GCPã§30ä¸ã®è«æ±ãããã®ãè¦ããã§ãããè¯ãæãåºã§ããã
â»30ä¸æº¶ãããè¨äº
nonbiri-tereka.hatenablog.com
æçµçµæã¨ãã¦ã¯ãRetrieval:5ä½ï¼éï¼ãRecognition:12ä½ï¼éï¼ã«ãªããã©ã¡ããéãçã£ã¦ããç§éã¨ãã¦ã¯æããæ°æã¡ã«ãªãã¾ããã
ããããRetrievalã«ã¦ICCVã«çºè¡¨ããæ©ä¼ãããããé常ã«å¬ããã£ãã§ãã
Kaggleãªã©ææãå½éå¦ä¼ã§ãã¡ãã¨å¯¾å¤çã«å ±åããã®ã¯ä¸ã¤ã®ç®æ¨ã ã£ãã®ã§ããããå®ç¾ã§ããã®ã¯è¯ãã£ãã§ãã
åç»ã¯ãã¡ã
www.youtube.com
Kaggleã«åãçµãã§æã£ããã¨
ãã®çµé¨ãããæã è°è«ãããKaggleãã£ã¦ã¦ã©ãã ã£ãã®ãã¨ãã£ã話ãæ¸ãã¦ãããã¨æãã¾ãã
è¯ãã£ããã¨
ãã¼ã¿ãè¦ãã°ããããªæå³ã§ãã°ãããããã
ä»äºã§ãå½ç¶ã§ããããã¼ã¿ãè¦ã¦ãåæãããã¨ãå¿
è¦ã«ãªã£ã¦ãã¾ãã
ç§ããã¡ããã§ããã大åã®æ¹ã¯ä¸åº¦ãããã¯äº¤å·®æ¤è¨¼ãã¹ãããããããã¨ãããã¨æãã¾ãã
å®éã®ä»äºã®ã·ã¹ãã ãèæ
®ããã¨æ¤è¨¼æã®ãªã¼ã¯ã¯é常ã«å±éºãªãã®ã§ãPoCå¾ã«ãã·ã¹ãã åãã¦ãæå¾
ã¨éãã¨æãããã®ã¯åé¡ã§ãã
Kaggleã¯ãã®æè¦ããã¼ãªã¹ã¯ã§ä½é¨ã§ãã¾ããï¼ãªã¹ã¯ã«å¾ã§ã·ã§ãã¯ãåããã¨ãã¯çãã¦ãã¾ãï¼
ææ°ã®å¤ã
Kaggleã§ã³ã³ããããã¤ãçµé¨ããã¨ãæå¦åãããèªåã§èããææ¦ãã¦ããçµæãç¥è¦ãããã¨æãã¾ãã
ããã«åºã¥ããå®ãã¼ã¿ã«å¯¾ãã¦ãã®çµé¨ãé©ç¨ã§ãããã§ããªããããã®å¤æãã§ããããã«ãªãã
ã¾ããã©ãããã°è§£ããããããªãã¨ãªãè¦ããããã«ãªã£ã¦ãã¾ãã
ããã¦å¤§ä½ã®å ´åãå®è£
ã®ã¹ããã¯ãæã£ã¦ãããã¨ãå¤ãã®ã§ããã®å®è£
ãå©ç¨ããã°ãããã«è©¦ãã¾ãã
ãããã£ãææ°ã®å¤ãï¼ï¼ã¢ã¤ãã¢ã®å¤ãï¼ã¯é常ã«å½¹ç«ã¤ã®ã§ãKaggleãã£ã¦ã¦ããã£ãã¨æããã¨ã¯ããã¾ãã
ï¼ããç´é¢ãã¦ãå®éä»ã¾ã§ãã£ããã¨ããããã®ãå¤ãã§ãï¼
精度ã®è¦ç©ããã¨å®ç¾ã§ããææ³
ã³ã³ãã®çµé¨ãå¤ããªã£ã¦ããã¨ããããããã®æ¤è¨¼ã精度ãããã«é æã¡ã«ãªããããã
ç´æçã«é£ããããã®åºå¥ãã¤ãããã«ãªã£ã¦ããã¨æã£ã¦ãã¾ãã
ã¾ããåé¡ãè¦ã¦ããã«ãã®ææ³ã ã¨ã»ã¼æåãããã¨ãã£ããã®ãçµé¨ãã¼ã¹ã§ãããã®ã¯ããªãå®å¿ã§ãã¾ãã
ãããã£ããã¨ãçµé¨ãã¼ã¹ã§å¾ãããã®ã¯é常ã«è²´éãªå ´ã ã¨æãã¾ãã
æªãã£ããã¨ï¼èº«ã«ã¤ããªããã¨
åé¡å®ç¾©ãããè½å
Kaggleã®ã³ã³ãã¯éå¬å°ç¹ã§åºæ¬çã«åé¡ã¨è©ä¾¡ãå®ç¾©ããã¦ãã¾ãã
ãã ããå®æ¡ä»¶ã¯æ©æ¢°å¦ç¿ã使ã£ã¦ãããããã¨ã決ãããã¨ãå¤ãã¨æãã¾ãã®ã§ãã·ã¹ãã çã«ã©ã®ãããªç©ãè¯ãã®ãããªã©ãããã£ããã®ã®å½¹ã«ã¯ç´æ¥ã¯ç«ã¡ã¾ããã
ãããããã®åé¡ã解ããããã®å¤æã¯ãªãã¨ãªããããããã«ãªãã®ã§ããã®è¨å®ã§åé¡ãªããããããã¾ãã
ç²¾ç¥åã®æ¶è
ç¹ã«ä¸ä½ã«ãã¦è¿½ãæãããã¨ãã®ã¹ãã¬ã¹ã¯å±éºã§ãã
è¨ç®ä¸ã¯æ°æ´ããããªãã¨æ£å¸¸ãªç²¾ç¥ãä¿ã¦ãªããã¨ãå¤ã
ããã¾ããã
Kaggleã§åã¤ï¼ã³ã³ãç¶ããã®ã«ã¯ç²¾ç¥åãå¿
è¦ã§ããï¼ä»ã®ãã¨ã«æãã¤ããªãã»ã»ã»ï¼
ä»å¾ã®ææ¦
Kaggle Championship
ä»å¹´ã®ä¸çªå¤§ããªç®æ¨ã®ä¸ã¤ã¯ãã®ã³ã³ããã£ã·ã§ã³ã§ãã
ä¸åº¦ãNew Delhiã§åå ãã¦ãã¾ãããæ®æ®µã¨éãè½åãåããã¦ãããåºæ¿çã§ããã
4æéã¨ããç§ãåå ããä¸ã§å²ä¸æçã®ã³ã³ãã§ããããåå ãããã¨ã§ã®å¦ã³ãå¤ããããæ¬æ¦åºå ´ã«åãã¦ä¸ã¤ä¸ã¤ç©ã¿ä¸ãããã¨æã£ã¦ãã¾ãã
çããã¨ã¹ãã¤ã³ã§ãä¼ããããã®ã§ãããã°ãã¾ãã
å¦ä¼ç³»ã³ã³ãã¸ã®åå
Kaggleã«éãããå¦ä¼ã®ä¸ã§ä¸»å¬ããã¦ããã³ã³ãã«ãåå ãã¦ãããã¨æã£ã¦ãã¾ãã
ä¾ãã°ãRecSysãKDDã§ã³ã³ããéå¬ããã¦ãã¾ããããããã£ãã¨ãããææ¦ãããã¨èãã¦ãã¾ãã
Kaggleã¨ã¯éã£ãç¥è¦ãç²å¾ã§ããããªã®ã§ãç©æ¥µçã«æ°ããç¥èãå¾ã¦ããã¾ãã
æ å ±çºä¿¡
Kaggle Grandmasterã«ãªãã¾ã§ãã®éæã«å®å
¨ã«ãããããã«ãªã£ã¦ããããã¾ãä»ã®ãã¨ã«åãçµãæéãåãã¦ããã¾ããã§ããã
ã³ã³ãåå ãã¦ãYoutubeãããã°ãªã©ä½ããã®å½¢ã§æ¸ãæ®ããã¨ã大äºã ã¨æãã®ã§ãæ¥å¹´ã¯å¢ããã¦ãããã°ã¨æã£ã¦ãã¾ãã
æå¾ã«
Grandmasterã«ãªãã¾ã§ãé常ã«é·ãéã®ãã§ããã
ãã®é·ãæéã§å¤ãã®ã³ã³ãã«åå ãã¦ãã¾ããããå¦çãã社ä¼äººã¨ç¡é§ãªãã¨ã¯ãªãã£ããªã¨æ¯ãè¿ã£ã¦æãã¾ãã
ã³ã³ãã¯å¼ãç¶ãåå ãã¦ããã¾ãã®ã§çãããããããé¡ããã¾ãã
Google Cloud Storageï¼GCSï¼ã§ãã£ãã30ä¸ä»¥ä¸æº¶ããã話
çããããã«ã¡ã¯ã
ã³ã³ãã§é å¼µã£ãã®ã§ç²ãã¾ããã
ãã¦ãGoogle Landmark 2021ãçµäºããRetrieval5ä½ï¼éï¼ãRecognition12ä½ï¼éï¼ã¨ãªãã¾ããã
æ¬æ¥ã¯èªæã¨åçã«ãããã¯ã©ã¦ãã§30ä¸åæ¶å¤±ãã話ã
è¨é²ã¨ãã¦æ¸ããã¨æãã¾ããçããç§ãè¦ã¦åé¢æ師ã«ãã¦ãã ããã
äºè±¡
9æå
¥ã£ã¦ããLandmark2021ã«åå ããGoogle Cloud Platformãé称GCPãå©ç¨ãã¦ããã
主ãªå©ç¨ã¯Google Cloud Storageã®ã¿ã§ãã»ã¼å®¹é課éã ããã¨é«ãããã£ã¦ããã課éè«æ±ã®ä¸éãªã©å
¥ãå¿ãã¦ã¾ããã
ããã¨9/18ã«ä¹
ã
ã«è«æ±é¡ã確èªããã¨32ä¸ã»ã©ã®è«æ±é¡ãããã¾ããã
ãããã«ç®çãé£ã³åºã¦ã調æ»ã«ããã£ãã¨ãã£ããã®ã«ãªãã¾ãã
課éå 容ã確èªãããåå ã¯ããã«ãããããã¼ã ã§å¯¾çãæã¡ã¾ãããï¼ç§ãæ ã¦ã¦å¦ç¿ã«ã¹ããããããï¼
çç±
課éã®è¡¨é¢çãªäºè±¡ã¯GCSã®å¤§é¸ééä¿¡ã§ãã
GCSã¯ã©ãããå©ç¨ãããã«ãããéä¿¡éã«å¿ãã¦èª²éããããã¨ãã£ãä½ç³»ã«ãªã£ã¦ããã
ãã®é¨åãå®å
¨ã«ã¿ãã¨ãã¾ããã
ä»åã2人ã§Landmarkãåãçµãã§ãããTPUãä¸å¿ã«å®æ½ãã¦ãã¾ããã
TPUã§è¡ãå¿
è¦ããã£ãã®ã¯Landmarkã巨大ãªãã¼ã¿ã§ãã£ããããããã¦ãGCSãå©ç¨ããã®ã¯TFRecordããã¼ã«ã«ã«è½ã¨ãå¿
è¦ããªãã£ãããã§ãã
ç¸æ¹ã®GCPã®ã¤ã³ã¹ã¿ã³ã¹ãã¨ã¼ããããç§ãæ ¼ç´ãã¦ãããã¼ã¿ã®GCSã®ãªã¼ã¸ã§ã³ãåç±³ã«ãã£ããã¨ã«ããã大é¸ééä¿¡ãè¨å¤§ã¨ãªãã課éããã¦ãã¾ã£ãã¨ãããã¨ã§ãã
æ£ç´ããã¼ã ãã¼ã¸ãã¦åãçµãå ´åã«å¤§é¸ééä¿¡ã®ã³ã¹ããªã©ãå½±é¿ãããã¨ãå®å
¨ã«è¦è½ã¨ãã
ãã®ãããã®å
±éèªèãåããªãã£ãã®ã¯å¤§ããªåçç¹ã§ãã
éã«è¨ãã°ããã¼ã çµãçããã¯ãã¡ãã¨èªèãåãã¾ããããAWSã®S3ã§ãä¼¼ããããªèª²éä½ç³»ã ã£ãã¯ãã§ãã
対ç
1. 課éé¡ã®ã¢ã©ã¼ããããããã
ã·ã³ãã«ã§ãããã©ããªã«ããã¼ããã®ã§ãå¿
ãè«æ±ã¢ã©ã¼ãããããã¾ãããã
ä½ãèµ·ãããããããªãã®ã§ãä»æãã¦ããã¦æã¯ããã¾ããã
åã¯æ²¹æãã¦ç®çãé£ã³åºã¾ããã
2. ãã¼ã å
ã®ãªã¼ã¸ã§ã³ã確èªããã
ãã¼ã¿ã»ããã®å
±æãªã©ã¯ã¹ãã¬ã¼ã¸ãå©ç¨ãããã¨ã¯å¤ãã¨æãã¾ãã
ç¹ã«TPUé¢é£ãå©ç¨ããéãGCP/GCSãå©ç¨ãããã¨ã«ãªãã®ã§ãéä¿¡ã³ã¹ããããããªãããã
ãã¼ã ã¡ã³ãã¼ã§ã®ãªã¼ã¸ã§ã³çµ±ä¸ãªã©ã¯äºåã«è¡ã£ã¦ããã¾ãããã
æå¾ã«
ããããTPUãçé¢ç®ã«éç¨ããªãéãèµ·ããå¾ãªãäºè±¡ã§ã¯ããã¾ããã
ç§ãåé¢æ師ã«ãã¦ããã£ãããçºçãããæ£ããã¯ã©ã¦ãã©ã¤ãããéããã ããã
åæ£æ·±å±¤å¼·åå¦ç¿ã©ã¤ãã©ãªHandyRLãã³ã³ãã§ä½¿ã£ã¦ã¿ãã
çããããã«ã¡ã¯
ãå
æ°ã§ãããããã°æ¸ããªãããå½ãã¼ã ã®ã¬ãã§ã¦ãè¦å®ã£ã¦ãã¾ãã
æè¿ã¾ã§HungryGeeseã«åå ãã¦ããããã®ã³ã³ãã§HandyRLã©ã¤ãã©ãªã«ã¯å¤§å¤ãä¸è©±ã«ãªãã¾ããã
ãã®ã³ã³ãã§HandyRLãæ¹é ãã¦ä½¿ã£ãã®ã§ããã®ãã¤ã³ããè¨é²ã¨ãã¦æ®ãã¦ããã¾ãã
HandyRLã¨ã¯
ä¸è¨ã§è¨ãã°ãPyTorchã§å©ç¨ã§ãã軽éãªæ·±å±¤åæ£å¼·åå¦ç¿ç¨ã®ãã¬ã¼ã ã¯ã¼ã¯ã§ãã
å®éã«ä½¿ã£ã¦ã¿ãææ³ã¨ãã¦ããããã¾ã§ã®å¼·åå¦ç¿ã®FWããç´æçã«ç解ãããããã®ã§ããã
åæ£æ·±å±¤å¼·åå¦ç¿ã§ã¯ãã®2ã¤ã®å¦çãåæã«è¡ã£ã¦ãã¾ãã
1. ã¨ã¼ã¸ã§ã³ããèªå·±å¯¾æ¦ããã¦ã¨ãã½ã¼ããçæããå¦ç
2. çæããã¨ãã½ã¼ãã使ã£ã¦ã¢ãã«ãå¦ç¿ãããå¦ç
ãããèªåã§å®è£ ããã®ã¯é常ã«éª¨ãæãããã®ã§ããããã®ãããããããã«å®è£ ããã¦ããã使ãããããã®ã«ãªã£ã¦ã¾ããã
HandyRLã®ä½¿ãæ¹
åºæ¬ç·¨
åºæ¬ã¯ãã¥ã¼ããªã¢ã«ãèªãã ã»ããæ©ãã§ãã
åºæ¬çãªæµãã¨ãã¦ãã®ããããæãã¦ããã¾ãããããã£ã3Stepã§ã§ãã¾ãã
- ã²ã¼ã ãã¨ã«Enviroment Classãä½æãããï¼ãã¥ã¼ããªã¢ã«ã ã¨ãTicTacToeï¼
- è¨å®ï¼config.yamlï¼ãå¤æ´ããã
- å¦ç¿ããã
â»æ°ãåãããå¥éè¨äºæ¸ãããã»ã»ã»
Tips
ã³ã³ãã§åã¤ã«ã¯ãä¸è¨ã®åºæ¬ã ãã ã¨å¯¾å¿ãã¥ããé¨åãããã¾ãã
ãã®ãããä»ã³ã³ãã§ãå©ç¨ã§ããæ¹é ãã¤ã³ããTipsãæ¸ãã¦ããã¾ãã
èªå·±å¯¾æ¦ä»¥å¤ã§ã¨ã¼ã¸ã§ã³ãä½æ
HandyRLã®ããã©ã«ãã¨ã¼ã¸ã§ã³ãã¯ãèªå·±å¯¾æ¦ã«ãªãã¾ãã
ããããå¤æ§æ§ã®è¦³ç¹ããããç¨åº¦ãæ§ã
ãªã¨ã¼ã¸ã§ã³ãã¨å¯¾æ¦ãããã»ããè¯ãã§ãã
èªå·±å¯¾æ¦ä»¥å¤ã®ã¨ã¼ã¸ã§ã³ããå©ç¨ããå ´åãtrain.pyã¨worker.pyãå¤æ´ããå¿
è¦ãããã¾ãã
ä»åã¯å¤æ´ã®ä¾ã¨ãã®è§£èª¬ãç°¡åã«è¡ãã¾ãã
train.pyã®L587ä»è¿
for p in self.env.players(): if random.random() > 0.5: args['model_id'][p] = -1 else: args['model_id'][p] = self.model_era is_self_model = True players.append(p) # èªå·±å¯¾æ¦ãªã¹ã if is_self_model is False: p = random.choice(self.env.players()) args['model_id'][p] = self.model_era players.append(p)
å
¥åã®å¤ã-1ã§ããã°ãäºåã«å¦ç¿æ¸ã®ã¨ã¼ã¸ã§ã³ãã使ã£ã¦ã¨ãã½ã¼ããçæããã
ã¾ããself.model_eraï¼ï¼å¦ç¿åæ°,Epochï¼ã§ããã°ãèªå·±å¯¾æ¦ç¨ã¨ã¼ã¸ã§ã³ããå©ç¨ãããã¨ãã£ãæ¹å¼ãæ³å®ãã¦å
¥åãã¦ãã¾ãã
å
¥åããããã¼ã¿ã«ãã£ã¦ã©ã®ã¢ãã«ãã¯ãworker.pyã§é¸æããããã«ãã¾ãã
worker.py
class Worker: def __init__(self, args, conn, wid): # çç¥ã以ä¸ã追å ãã¢ãã«ãPoolãã¦ããå¦çãget_modelsã§ã¨ã¼ã¸ã§ã³ãã¨ãªãã¢ãã«ã®ä¸è¦§ãåå¾ããã self.trained_models = [ModelWrapper(model, ts=1) for model in get_models()] + [ModelWrapper(model, ts=2) for model in get_2ts_models()] def _gather_models(self, model_ids, role="g"): model_pool = {} for model_id in model_ids: if model_id not in model_pool: if model_id < 0: if role == "g": model_pool[model_id] = self.trained_models # Poolããã¢ãã«ãå©ç¨ããã elif model_id == self.latest_model[0]: model_pool[model_id] = self.latest_model[1] else: model_pool[model_id] = ModelWrapper(pickle.loads(send_recv(self.conn, ('model', model_id))), ts=-1) if model_id > self.latest_model[0]: self.latest_model = model_id, model_pool[model_id] return model_pool def run(self): while True: args = send_recv(self.conn, ('args', None)) role = args['role'] models = {} if 'model_id' in args: model_ids = list(args['model_id'].values()) model_pool = self._gather_models(model_ids, role=role) # make dict of models for p, model_id in args['model_id'].items(): if model_id < 0: models[p] = deepcopy(random.choice(model_pool[model_id])) # Poolã®ä¸ããã©ã³ãã ã«é¸æããã else: models[p] = model_pool[model_id]
å¦ç¿æ¸ã¢ãã«ãå©ç¨ããå®è£
ã§ããããã°Poolã®ãããªãã®ã§ãå¦ç¿æ¸ã¢ãã«ããã®ä¸ããé¸æããæ¹å¼ã§ãã
ä¸è¨ã³ã¼ãã§ã¯æ¬¡ã®ãã¨ãè¡ã£ã¦ãã¾ãã
ã»å¦ç¿æ¸ã¢ãã«ãã³ã³ã¹ãã©ã¯ã¿ã§åæå
ã»_gather_modelsã§ãã¨ãã½ã¼ãçææã«model_idã-1ã®å ´åã«ã¢ãã«Poolãé¸æ
ã»runã§Poolã®ä¸ããä¸ã¤ã¢ãã«ãé¸æãã対æ¦ãããã
æ§ã ãªã¨ã¼ã¸ã§ã³ãã§è©ä¾¡
åæå¤ã ã¨ã©ã³ãã åä½ã§ã®è©ä¾¡ã«ãªãï¼HungryGeeseã ãï¼ï¼ã®ã§ãæ£ç´ããç¨åº¦å¦ç¿ãããã¨å¼±ããã¦ã»ã¼åå©ãæå³ã®ããè©ä¾¡ãã§ããªããªãã¾ãã
ãã®ãããå¤æ§æ§ãããã¤ã¤ããããç¨åº¦å¼·ãã¨ã¼ã¸ã§ã³ãã§è©ä¾¡ãå¿
è¦ã§ãã
ãã¡ããtrain.py/worker.pyãä¿®æ£ããå¿ è¦ãããã¾ãã
train.pyã®L596ä»è¿
elif args['role'] == 'e': # evaluation configuration args['player'] = [self.env.players()[self.num_results % len(self.env.players())]] for p in self.env.players(): if p in args['player']: args['model_id'][p] = self.model_era else: args['model_id'][p] = -1 self.num_results += 1
train.pyã§ã¯ãä¸ã¤å¿ ããå¦ç¿ãã¦ããã¢ãã«ãé¸æããæ®ããè©ä¾¡ã¨ãã¦é¸æããããã®ã¢ãã«ã¨ãã¦è¨å®ãã¾ãã
worker.py
class Worker: def __init__(self, args, conn, wid): self.evaluate_models = [ModelWrapper(model, ts=1) for model in get_models()] + [ModelWrapper(model, ts=2) for model in get_2ts_models()] def _gather_models(self, model_ids, role="g"): model_pool = {} for model_id in model_ids: if model_id not in model_pool: if model_id < 0: if role == "g": # ç¥ else: model_pool[model_id] = self.evaluate_models
roleã"g"ã§ããã°ãã¨ãã½ã¼ãçæã"e"ã§ããã°ãè©ä¾¡ã«ãªãã¾ãã
ãã®ãããè©ä¾¡ãããå ´åã¯å®ç¾©ãã¦ããããã®ããã©ã³ãã ã«é¸æããå®è£
ã«ãã¦ãã¾ããï¼é¸æé¨ã¯å¦ç¿ã¨åãé¸æä»æ§ï¼
èªå·±å¯¾æ¦ã¢ãã«ãä¸å®æéä¿åãã
ä¸å®æéã®Episodeãä¿åãã¦ããããã®ã¨ã¼ã¸ã§ã³ãã¨å¯¾æ¦ããããã¨ãã£ãã±ã¼ã¹ãèãããã¾ãã
ããã«ããå¦ç¿ãé²ããçµæãä»ã¾ã§ã®ã¢ãã«ã«è² ããã¨ãã£ããã¨ãé²ãåãçµã¿ã§ãã
ä¾ãã°ãAlphaStarã§ã¯éå»å¦ç¿ãããã¨ã¼ã¸ã§ã³ããä¿åãã¦ããã対æ¦ãããããªãã¨ãããã¾ããã
ãã®æ¹å¼ãworker.pyãå¤æ´ãããã¨ã§å®ç¾ãã¾ããã
class Worker: def __init__(self, args, conn, wid): # çç¥ã以ä¸ã追å ãèªå·±å¯¾æ¦ã¢ãã«ç¨ã®Pool self.self_fight_models = [] def _gather_models(self, model_ids, role="g"): model_pool = {} for model_id in model_ids: if model_id not in model_pool: if model_id < 0: if role == "g": if len(self.self_fight_models) == 0: model_pool[model_id] = self.trained_models else: model_pool[model_id] = \ random.choices([self.self_fight_models, self.trained_models], k=1, weights=[1, 1])[0] # èªå·±å¯¾æ¦ã¢ãã« or å¦ç¿æ¸ã¨ã¼ã¸ã§ã³ã else: model_pool[model_id] = self.evaluate_models elif model_id == self.latest_model[0]: # ç¥ else: model_pool[model_id] = ModelWrapper(pickle.loads(send_recv(self.conn, ('model', model_id))), ts=-1) if model_id > self.latest_model[0]: self.latest_model = model_id, model_pool[model_id] if model_id % 300 == 0: # 300å¦ç¿ã«ã¤ãä¸ã¤å¯¾æ¦ç¨ã®Poolã«è¿½å ããã self.self_fight_models.append(model_pool[model_id]) if len(self.self_fight_models) > 100: # 100件以ä¸ä½ãããã°æåã®ãæ¨ã¦ãã self.self_fight_models = self.self_fight_models[1:]
å¦ç¿æ¸ã¢ãã«ã®å®è¡
äºåã«å¦ç¿ããã¢ãã«ã使ãããã¨ãã£ãå ´é¢ãããã¾ãã
ä¾ãã°ãKaggleã§ã¯ãä¸ä½LBãªã©ä»ã¨ã¼ã¸ã§ã³ãã®ã¨ãã½ã¼ããç²å¾ã§ãã¾ãã
ãããç¨ãã¦åå©ã¢ãã«ã®è¡åãäºåã«æ¨¡å£å¦ç¿ãããã¨ã§ãããä¸å®ã®å¼·ãã®ã¨ã¼ã¸ã§ã³ãããå¦ç¿ãéå§ã§ããå¦ç¿ã®é«éåãè¦è¾¼ãã¾ãã
ã½ã¼ã¹ãã»ã¼å¤æ´ããªãã¨ãå
·ä½çã«ã¯æ¬¡ã®æ¹å¼ã§å®ç¾å¯è½ã§ãã
1. modelsãã£ã¬ã¯ããªãä½æããã¢ãã«ãã1.pthããã¦é
ç½®ããã
2. è¨å®ã®ãconfig.yamlãã®ãrestart_epochãã1ã«ããã
3. å¦ç¿ãå®è¡ããã
HandyRLã¯episodeã®è¨å®ã1以ä¸ã§modelsé
ä¸ã®ã¢ãã«ãå©ç¨ããæ¹å¼ãæ¡ç¨ãã¦ãã¾ãã
ã¾ããããã©ã«ãã®èªã¿è¾¼ã¿ï¼pytorchã®load_state_dict)ã®Strict=Falseã¨ãªã£ã¦ãããããè¥å¹²ã®æ§é å¤åã«ã¯å¯¾å¿ã§ãã¾ãã
決å®çåä½ã§åãã
HandyRLã®ã¨ãã½ã¼ãçæã§ã®ã¨ã¼ã¸ã§ã³ãã®ã¢ã¯ã·ã§ã³ã¯ã¢ãã«ã®åºåã®åå¸ãããµã³ããªã³ã°ã«ãªãã¾ãã
ããããä¸çªç¢ºåº¦ãé«ãããªè¡åã決å®çã«åãããã»ããã¨ã¼ã¸ã§ã³ãã¨ãã¦ã¯ï¼ããããï¼å¼·ããªãã¾ãã
train.pyã®L596ä»è¿
for p in self.env.players(): if random.random() > 0.5: args['model_id'][p] = -1 else: args['model_id'][p] = self.model_era is_self_model = True players.append(p) if random.random() < 0.05: determistics.append(True) else: determistics.append(False) args['determistics'] = determistics
ããã«ããdetermisticsã«åãã¬ã¤ã¤ã¼ã決å®çã«åããã©ãããå
¥åãã¦ãã¾ãã
ï¼å®è£
ä¾ã¯5%ã®ç¢ºçã§æ±ºå®çã«åä½ããã¨ã¼ã¸ã§ã³ãã«ãªãï¼
ã¾ããgeneration.pyã®L53ã®æ¬¡ã®ç®æãä¿®æ£ãã¾ãã
if args['determistics'][player]: action = legal_actions[np.argmax(p[legal_actions])] else: action = random.choices(legal_actions, weights=softmax(p[legal_actions]))[0]
ããã«ãããdetermisticsãã©ã°ãTrueã§ããã°ã決å®çã«åä½ããããã«ãã¦ãã¾ãã
ææ³
ä»ã¾ã§å¼·åå¦ç¿ãè¡ãã¨ãªãã°ãè¤éãªã©ã¤ãã©ãªãå®è£
ãèªã¿è§£ãå¿
è¦ããããå°ãæ¹é ããã«ã大å¤ã ã¨æãã¦ãã¾ããã
ããããHandyRLã¯é常ã«ã·ã³ãã«ãªæ§æã§å®è£
ãèªã¿ããããæ±ããããã£ãã§ãã
ã·ã¥ãã¬ã¼ã·ã§ã³ã³ã³ããªã©ã§å¼·åå¦ç¿ãè¡ãå ´åã¯ãã®ã©ã¤ãã©ãªãç©æ¥µçã«ä½¿ãã®ãä»å¾è¯ãããã«æãã¾ãã
æå¾ã«ãããå©ç¨ããã®ã¯HandyRLãã¼ã ãç©æ¥µçã«HungryGeeseã§å¦ç¿ã®æ¡ä»¶ãNotebookãå
¬éããã ããã·ã¥ãã¬ã¼ã·ã§ã³ã³ã³ãã¨å¼·åå¦ç¿ã¸ã®éå£ãä¸ãã¦ããã£ãããã§ããã
ä»åãHungryGeeseã§ãã«ã«æ´»ç¨ããã¦ããã ããææ°ã®å¼·åå¦ç¿ã®ãã£ããã¢ããå«ããåå¼·ã«ãªãã¾ããããããã¨ããããã¾ããã