Upgrade to Pro — share decks privately, control downloads, hide ads and more …

実践 PyTorch Lightning (2019/11/30 分析コンペLT会 #1)

F48d3107f5e7a4c6f765752df9754e6b?s=47 fam_taro
November 30, 2019

実践 PyTorch Lightning (2019/11/30 分析コンペLT会 #1)

2019/11/30 分析コンペLT会 #1 で LT させていただいたスライドです。
https://kaggle-friends.connpass.com/event/154881/

F48d3107f5e7a4c6f765752df9754e6b?s=128

fam_taro

November 30, 2019
Tweet

Transcript

  1. ࣮ફ 1Z5PSDI-JHIUOJOH !GBN@UBSP  ෼ੳίϯϖ-5ձ  !͔͙ΔʔͲ

  2. ࣗݾ঺հ – ໊લ౻ຊ༟հ 5XJUUFS!GBN@UBSP – ུྺ – ૣҴాେֶେֶӃम࢜՝ఔमྃ  ࣗવݴޠॲཧ

    –  4*FS ۚ༥ܥ –  ೿ݣձࣾ 42- –  /PX-1*9&- – ۦ͚ग़͠ ,BHHMF.BTUFS – ઌʑि  ͳΓ·ͨ͠ʂ 
  3. ࠷ۙͷίϯϖྺ ࣌ظ ,BHHMFίϯϖ ੒੷ ίϝϯτ ݄ 4**."$31OFVNPUIPSBY 4FHNFOUBUJPO ؾڳίϯϖ 5PQ

     ॳ(PME ɻͨͩ͠ 1Z5PSDIʹΑΔେ͖ͳෛͷҨ࢈Λ ࡞ͬͯ͠·ͬͨ ݄ 4FWFSTUBM4UFFM%FGFDU %FUFDUJPO మίϯϖ 5PQ  1Z5PSDI-JHIUOJOHσϏϡʔ രࢮ ݄ 34/"*OUSBDSBOJBM )FNPSSIBHF%FUFDUJPO ೴ίϯϖ 5PQ  Θʔ͍ʂʢ!"QQJBO͞ΜͷίʔυΛؙύΫϦͯࣗ͠ ෼Ͱॻ͜͏ͱ͠ͳ͔ͬͨʣ ݄ 6OEFSTUBOEJOH$MPVETGSPN 4BUFMMJUF*NBHFT Ӣίϯϖ 5PQ  1Z5PSDI-JHIUOJOHϦϕϯδ ͳΜͱ͔ 4PMP4JMWFS
  4. ໨࣍  എܠ  1Z5PSDI-JHIUOJOHͱ͸  4UBSU1Z5PSDI-JHIUOJOH  1Z5PSDI-JHIUOJOHͷ஫ҙ఺ 

    ײ૝ͱ݁࿦  ͓·͚ɿίϯϖʹ଱͑͏Δ 1Z5PSDI-JHIUOJOH
  5. ஫ҙࣄ߲ • 1Z5PSDIͷ࢖༻͕લఏͱͳ͍ͬͯ·͢ • ࢖͍ͬͯͳ͍ਓ͝ΊΜͳ͍͞ʢศར͔ͩΒ͓͢͢ΊͰ͢Αʣ • ͔ͭ͋Δఔ౓࢖ͬͨਓ͕ϝΠϯλʔήοτͰ͢ • ͱ͜ΖͲ͜ΖςΫχΧϧͳ୯ޠ͕͋Δ͔΋͠Ε·ͤΜ •

    ύοτݟΑ͘෼͔Βͳ͔ͬͨΒ͍ͭͰ΋ฉ͍͍ͯͩ͘͞ • ࠓճͷίʔυ Ӣίϯϖ༻ ͸Լهʹஔ͍ͯ͋Γ·͢ • IUUQTHJUIVCDPNZVLLZP,BHHMF6OEFSTUBOEJOH$MPVETUITPMVUJPO • ͜ͷ -5Ͱ͸ QZUPSDIMJHIUOJOHΛ૝ఆ͍ͯ͠·͢ • ͢Ͱʹ࠷৽൛͸ Ͱ͢͝ΊΜͳ͍͞
  6. എܠ • 1Z5PSDIͨͷ͍͠ʂ • ωοτϫʔΫߏ଄ม͑Δͷָ • -PTTपΓ΋͍͡Δͷָ • ࣗ෼Ͱ৭ʑ͍͡ΕΔͷͰཧղ͠΍͍͢ •

    ͳΜ͔ͨͷ͍͠ʂ • 1Z5PSDIͰίϯϖࢀՃ͢Δͷ΄Μͱͨͷ͠ʔʂ
  7. ؾڳίϯϖΛऴ͑ͨ͋Δ೔ͷ͜ͱʜ ͞ʔͯ๻ͷ ̈(PME4PMVUJPÖ ࢖͍·Θͪ͠Ό͏ͧʔʂ

  8. ͕͔ͩ͠͠ʜ

  9. • ίʔυԚ͗͢ • ϝιου௕͗͢ • ৭Μͳͱ͜Ζʹ৭Μͳ΋ͷ͕͋Δ • ୭ͩΑ͜ͷίʔυॻ͍ͨͷ • ΋ͪΖΜࣗ෼Ͱ͋Δ

    • ίϯϖத͸ແզເத͚ͩͬͨͲʜ • ΋͏࢖͍ͨ͘ͳ͍
  10. Ԛ͘ͳͬͨཁҼ • ࣗ෼Ͱॻ͘ USBJO@B@FQPDI • ແݶʹਂ͘ͳΔ GPSϧʔϓʢFQPDI CBUDI FUDʜ •

    ແݶʹ૿͑ΔҾ਺ • ࣗ෼Ͱ΍Δ MFBSOJOH@SBUF@TDIFEVMFSTUFQ • ࣗ෼Ͱΰχϣΰχϣͯ͠͠·͏ (SBEJFOU"DDVNVMBUJPO • (SBEJFOU"DDVNVMBUJPO ޯ഑ྦྷੵ ɿύϥϝʔλߋ৽ PQUJNJ[FSTUFQ Λ਺όονʹճʹ͢Δ͜ͱͰ #4Λ૿΍͢͜ͱʹ͍ۙॲཧΛ͢Δ • #4େ͖͘͢Δ͜ͱͱ׬શʹ౳ՁͰ͸ͳ͍ͷͰ஫ҙ • ࣗ෼Ͱΰχϣΰχϣ͢Δ UREN • FUDʜ
  11. Ԛ͘ͳͬͨཁҼ • ࣗ෼Ͱॻ͘ USBJO@B@FQPDI • ແݶʹਂ͘ͳΔ GPSϧʔϓʢFQPDI CBUDI FUDʜ •

    ແݶʹ૿͑ΔҾ਺ • ࣗ෼Ͱ΍Δ MFBSOJOH@SBUF@TDIFEVMFSTUFQ • ࣗ෼Ͱΰχϣΰχϣͯ͠͠·͏ (SBEJFOU"DDVNVMBUJPO • (SBEJFOU"DDVNVMBUJPO ޯ഑ྦྷੵ ɿύϥϝʔλߋ৽ PQUJNJ[FSTUFQ Λ਺όονʹճʹ͢Δ͜ͱͰ #4Λ૿΍͢͜ͱʹ͍ۙॲཧΛ͢Δ • #4େ͖͘͢Δ͜ͱͱ׬શʹ౳ՁͰ͸ͳ͍ͷͰ஫ҙ • ࣗ෼Ͱΰχϣΰχϣ͢Δ UREN • FUDʜ ͲΕ΋ίϯϖͰઓ͏্Ͱ͸ ຊ࣭తͰ͸ͳ͍
  12. ΦϨΦϨ 5SBJOFSΫϥε΋ॻ͚Δ͚Ͳʜ • ઈରԚ͘ͳΔ • 8JOOFSTPMVUJPODPEFͰΑ͘ݟ͔͚Δ͚ͲେମԚ͍ • Ճ͑ͯඍົʹͦΕͧΕݸੑग़͖ͯͯ͠ਏ͍ • ͦͷ͏ͪؾ͔ͮͣʹόάຒΊࠐΈͦ͏

    • Ͱ͖Ε͹ͪΌΜͱͨ͠ઃܭʹԊ͍͍ͨ • ଞਓ ະདྷͷࣗ෼ؚΊ ͕Ҡ২͢Δͱ͖ʹָʹҠ২Ͱ͖ͯ΄͍͠ • ࣗ෼Ͱϝϯς͢ΔؾʹͳΕͳ͍ • ઈରਏ͍ • ͋ʔͲ͔͜ʹ๻ΑΓڧͦ͏ͳͻͱ͕ϝϯςͯ͘͠ΕΔ 5SBJOFS Ͷʔ͔ͳʔʁʁʁ
  13. ͦΜͳ͋ͳͨʹ

  14. 1Z5PSDI-JHIUOJOHͱ͸ • ԼهΛαϙʔτͯ͘͠ΕΔ 1Z5PSDIXSBQQFS • 4DBMFZPVSNPEFMT • .VMUJ(16ɾ.VMUJ/PEF5SBJOJOHɾOWJEJBBQFY .JYFE 1SFDJTJPO5SBJOJOH

    • ઃఆ΍ධՁࢦඪɾֶशࡁXFJHIUͷอଘͳͲ • 8SJUFMFTTCPJMFSQMBUF ఆܕจͷলུ
  15. • ӈਤ͸ެࣜϖʔδΑΓ • IUUQTHJUIVCDPNX JMMJBN'BMDPOQZUPSDI MJHIUOJOH • 1-͸ӈͷփ৭ͷ෦෼ ΛΧόʔͯ͘͠ΕΔ •

    ࢲୡ͸੨͍෦෼͚ͩू த͢Ε͹ྑ͍ʂʂ • ఔΑཻ͍౓ʂ
  16. 1Z5PSDI-JHIUOJOHͱ͸ େ͖͘ҎԼ ͭͷཁૉ͕͋Δ • -JHIUOJOH.PEVMF • 㲈 .PEFM %BUBTFU -PTT

    0QUJNJ[FS • USBJOJOH΍ WBMJEBUJPOͷ֤ TUFQͷಈ࡞ͳͲΛఆٛ • WBMJEBUJPOFOE࣌ʹ݁ՌΛͲ͏ू໿͢Δ͔ͱ͔΋ఆٛՄ • 5SBJOFS • %FWJDF (16PS$16 ΍ .JYFE1SFDJTJPO • .VMUJ(165ZQF %1PS%%1  • 8FJHIU΍ MPHͷอଘ৔ॴ • $BMMCBDL FBSMZTUPQQJOHͱ͔ • (SBEJFOU"DDVNVMBUJPO
  17. 4UBSU1Z5PSDI-JHIUOJOH • 4UFQQJQJOTUBMMQZUPSDIMJHIUOJOH • 4UFQ ඞཁͳਓ͸ OWJEJBBQFYΛผ్Πϯετʔϧ • 1Z5PSDI-JHIUOJOHΛ࢖͏͚ͩͳΒඞਢͰ͸ͳ͍ •

    Ͱ΋ศརͳͷͰݸਓతʹ͸ਪ঑ • 4UFQ-JHIUOJOH.PEVMFͷ࡞੒ • 4UFQ5SBJOFSͷ࡞੒ • 4UFQUSBJOFSGJU NZ@MJHIUOJOH@NPEVMF
  18. 4UFQ-JHIUOJOH.PEVMFͷ࡞੒ • -JHIUOJOH.PEVMF Λܧঝ • ҎԼͷؔ਺Λఆٛ • ඞਢ 3FRVJSFE •

    USBJOJOH@TUFQ • DPOGJHVSF@PQUJNJ[FST • 999@EBUBMPBEFS • ࣗ༝ 0QUJPOBM • WBMJEBUJPO@TUFQ • WBMJEBUJPO@FOE
  19. 4UFQ-JHIUOJOH.PEVMFͷ࡞੒ ೖྗ͔Β -PTTΛܭࢉͯ͠ฦ͢ ೖྗ͔Β -PTTΛܭࢉͯ͠ฦ͢ -PTT͚ͩ͡Όͳ֤͘ධՁࢦඪ΋Մೳ

  20. 4UFQ-JHIUOJOH.PEVMFͷ࡞੒ -PTTͷ߹ܭ஋ͱ͔৭ʑฦ͢ ίϯιʔϧදࣔ༻ QSPHSFTT@CBS ΍MPH༻ MPH ɺ DBMMCBDL༻ WBM@MPTT ͱ͔ࣗ෼Ͱ໊෇͚Δ

    ͳͲΛฦͤΔ PQUJNJ[FSΛฦ͢ TDIFEVMFS͸͋ͬͯ΋ͳͯ͘΋Մ
  21. 4UFQ5SBJOFSͷ࡞੒ -PHͷอଘํ๏΍ ԿΛอଘ͢Δ͔ 8FJHIUͷอଘํ਑ MBUFTUPS CFTUMPTT ΍ &BSMZ4UPQQJOH౳ .VMUJ(16ͷΦϓγϣϯ΋બ΂Δʂ ஍ຯʹ͏Ε͍͠

    HSBE@BDD Φϓγϣϯ
  22. 4UFQ5SBJOFSGJU QM@NPEVMF ˠ࣮ߦ ,FSBT -JLF

  23. 1Z5PSDI-JHIUOJOHͷ஫ҙ఺ • ·ͩ 4UBCMFͳόʔδϣϯͰ͸ͳ͍ • ޙํޓ׵ੑͳΜͯ؁͑͸ͳ͍ όʔδϣϯΞοϓ ॻ͖௚͠ඞਢ • 1Z$IBSNͱ͔ͷؔ਺δϟϯϓػೳ͸ඞਢʢ1Z5PSDIॳͷਓʹ͸ඇਪ঑ʣ

    • .VMUJ(16º .JYFE1SFDJTJPO5SBJOJOH ͷબ୒ࢶ͕ %%1ͷΈ • 1Z5PSDIͰ .VMUJ(16Λ࢖͏ͨΊͷબ୒ࢶ͸ %1ͱ %%1 • %1 %BUB1BSBMMFM • Πϝʔδ֤(16Λ߹ମͯ͠େ͖͍(16Λ࡞Δ • %%1 %JTUSJCVUFE%BUB1BSBMMFM • Πϝʔδ֤(16Ͱಠཱͯ͠ॲཧΛਐΊΔײ͡ • %BUBTFUΛ(16ຖʹ෼ׂ͢Δ • %1ͱ %%1ͷࠩ͸Լه͕Ұ൪෼͔Γ΍͍͢ • IUUQXXXUFMFTFOTDPEJTUSJCVUFEEBUBQBSBMMFMUSBJOJOH VTJOHQZUPSDIPOBXT
  24. 1Z5PSDI-JHIUOJOHͷ஫ҙ఺ • %%1࣌ʹ 7BMJE%BUB-PBEFSΛ෼ׂ͢Δͱ 7BMJE4DPSF͕ਖ਼ ͘͠ܭࢉͰ͖ͳ͍ Ұ෦͔͠࢖ΘΕͳ͍ • ݱঢ়෼ׂ͢Δͱ (16ͷ

    7BMJE4DPSF͔͠อଘ͞Εͳ͍ • ֤ (16Ͱܭࢉͨ͠ 7BMJE4DPSFΛू໿ SFEVDF Ͱ͖ͳ͍ • IUUQTHJUIVCDPNXJMMJBN'BMDPOQZUPSDIMJHIUOJOHJTTVFT • ͪΌΜͱ 7BMJE4DPSFΛܭࢉ͢ΔͨΊʹ͸ 7BMJE%BUB-PBEFSΛ෼ ׂͤͣʹ֤ (16Ͱܭࢉͤ͞Δ ༨෼ͳܭࢉΛ͠ͳ͍ͱ͍͚ͳ͍ • গ͚͕͔͔ͩ࣌ؒ͠Δ • ͋͘·Ͱ 7BMJEͳͷͰ 5SBJO࣌ؒʹൺ΂Ε͹ڐͤΔ͕
  25. 1Z5PSDI-JHIUOJOHͷ஫ҙ఺ • ॻ͘ίʔυྔ͕ΊͪΌͪ͘ΌݮΔΘ͚Ͱ͸ͳ͍ • ͦΕͳΓʹॻ͘ • ୹͍͚ͨͩ͘͠ͳΒ GBTUBJ ʹߦ͘΂͖ •

    ʮ1Z5PSDI-JHIUOJOHʯ ˠ ʮΦϨΦϨϧʔϓʯ΁ͷҠߦ͸ָ
  26. ࢖ͬͯΈͨײ૝ • ·ͩ·ͩൃల్্͚ͩͲظ଴େ • ݸਓతʹ͸ 1Z5PSDI*HOJUFΑΓ͸޷͖ • ΄ͲΑࣗ͘༝౓ͷ࢒ͬͨςϯϓϨʔτͰ͋Γɺڧ੍తʹ৑௕ͳ ϧʔϓΛ෼ׂ͢ΔΑ͏ʹͳΔͷͰݸਓతʹ͸خ͍͠ •

    ඞͣॻؔ͘਺͕ܾ·͍ͬͯΔͷͰɺଞλεΫ࢝ΊΔͱ͖΋࢝Ί΍͍͢ • ࠓ࢖͍࢝ΊΔͱ౓ʑؔ਺δϟϯϓΛ࢖Θ͟ΔΛ͑ͳ͍͚Ͳɺ ιʔείʔυΛಡΉ͜ͱͰ৭ʑษڧʹͳͬͨ • %JTUSJCVUFE%BUB4BNQMFSͱ͔
  27. ݁࿦ • .VMUJ(16पΓͷڍಈΛআ͚͹͍͍ͩͨຬ଍ʂ • 4JOHMF(16ͳΒؾʹͳΔͱ͜Ζ͸ͳ͍ • ,BHHMFͰ͸ 1Z5PSDI$BUBMZTU΋ྲྀߦͦ͠͏ͳͷͰཁνΣοΫ • $BUBMZTU͸

    4FHNFOUBUJPOUVUPSJBM͕ΫΦϦςΟߴ͔ͬͨͰ͢ • ྆ํ࢖ͬͯࣗ෼ʹ߹ͬͨ΄͏Λ࢖͏ͷ͕ྑ͍ͱࢥ͍·͢ • ࢼ͢ʹ΋͕͔͔࣌ؒΔ͚Ͳʜ • ͍ͣΕ΋ૉͷ 1Z5PSDIΑΓ͸டংΛײ͡ΒΕΔ • ؾʹͳΔਓ͸ԼهͰݕࡧͯ͠Έ·͠ΐ͏ • lQZUPSDI JHOJUFz lQZUPSDI DBUBMZTUz lQZUPSDI MJHIUOJOHz • ্ه͸͍ͣΕ΋ެࣜ IUUQTQZUPSDIPSHFDPTZTUFN Ͱ঺հ͞ΕͯΔ
  28. ͝ਗ਼ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠

  29. ͓·͚ɿ෼ੳίϯϖ-5ձͷ࢝·Γ

  30. ͓·͚ɿ෼ੳίϯϖ-5ձͷ࢝·Γ

  31. ͓·͚ɿ෼ੳίϯϖ-5ձͷ࢝·Γ

  32. ͓·͚ɿίϯϖʹ଱͑͏Δ 1Z5PSDI-JHIUOJOH • ͔͜͜Β͸ ,BHHMFͷ l6OEFSTUBOEJOH$MPVETGSPN 4BUFMMJUF*NBHFT Ӣίϯϖ z༻ʹ޻෉ͨ͠෦෼Λ঺հ͠·͢ •

    IUUQTHJUIVCDPNZVLLZP,BHHMF6OEFSTUBOEJOH$MPVETUITPMVUJPO • ΦϨΦϨ 1Z5PSDI-JHIUOJOHʹͳͬͯ͠·ͬͯΔͷͰ஫ҙ • ࣗ͝਎Ͱ֦ு͢ΔώϯτʹͳΕ͹ͱࢥ͍·͢ • FY͜͜Β΁ΜΛม͍͑ͨͱ͖͸͜͜Λมߋͪ͠Ό͑͹ྑ͍Μͩͳ
  33. ͓·͚ɿίϯϖʹ଱͑͏Δ 1Z5PSDI-JHIUOJOH • ओͳมߋ఺ • %JTUSJCVUFE4BNQMFS 1Z5PSDI-JHIUOJOH͸ؔ܎ͳ͍ • ࢦఆͨ͠ QPTJUJWFOFHBUJWFൺ཰Λ࢖༻͢Δ

    • 5SBJOFS ӢίϯϖͰ͸ద༻͸͠·ͤΜͰ͕ͨ͠ʜ • ຖ FQPDIຖʹ QPTJUJWFOFHBUJWFΛมߋͰ͖ΔΑ͏ʹͨ͠ • -PHHFS -JHIUOJOH-PHHFS#BTF • ෆཁͳ΋ͷΛอଘ͠ͳ͍Α͏ʹͯ͠࠷௿ݶͷ΋ͷ͚ͩอଘ͢ΔΑ͏ʹͨ͠ • ೖྗύϥϝʔλҰཡͱ͔͸ࣗ෼Ͱ :".-Ͱอ࣋ͯ͠ΔͷͰʜ • $IFDLQPJOU .PEFM$IFDLQPJOU • ҎԼͷೋछྨͷॏΈΛ྆ํอଘͰ͖ΔΑ͏ʹͨ͠ σϑΥϧτ͸ยํͷΈ • ࠷৽ FQPDIͷ XFJHIU MBUFTUQU #FTU-PTTͷ XFJHIU CFTU@MPTTQU • ͜Ε͸ JTTVFͳΜͩΑͳ • l DLQUzʹ͢Δͱ 1Z5PSDI-JHIUOJOHͷ໋໊نଇʹै͏ඞཁ͋Γ ໘౗
  34. 5SBJOFS ӢίϯϖͰ͸ະద༻ • ຖ FQPDIຖʹ QPTJUJWFOFHBUJWFΛมߋͰ͖ΔΑ͏ʹͨ͠ • SVO@UOH@FQPDI Λ PWFSSJEFͯ͠

    TBNQMFSΛຖ FQPDI͍͡Δ
  35. -PHHFS -JHIUOJOH-PHHFS#BTF Λܧঝͯ͠ • ࣗ෼ͷอଘ͍ͨ͠΋ͷ͚ͩอ ଘ͢ΔΑ͏ʹͨ͠ • !SBOL@[FSP@POMZ ͸ NVMUJ

    HQV ࣌ʹ (16ͷΈ࣮ߦ ͢ΔͨΊͷσίϨʔλ
  36. $IFDLQPJOU .PEFM$IFDLQPJOU • -BUFTUͱ #FTU.FUSJDTͷೋछྨͷ XFJHIUΛอଘͰ͖ΔΑ͏ʹ

  37. ͓ΘΓ