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

敷居の低いAI勉強会#3

asagiman
January 14, 2022
29

 敷居の低いAI勉強会#3

第3回G検定合格講座
1. 活性化関数
2. 学習率の最適化
3. 更なるテクニック
4. CNN:畳み込みニューラルネットワーク

asagiman

January 14, 2022
Tweet

Transcript

  1. Έ΍͜Ͱ*5
    ෑډͷ௿͍"*ษڧձ
    ϓϨθϯλʔɹTomohiro Iida
    ࢀߟॻ੶ɹʮσΟʔϓϥʔχϯάɹGݕఆެࣜςΩετʯɹ؂मɿJDLA

    View full-size slide

  2. ΞδΣϯμ
    ࣗݾ঺հʢ෼ʣ
    ࢀՃऀͦΕͧΕͷࣗݾ঺հʢ෼ʣ
    (ݕఆ߹֨ߨ࠲ ෼

    ./*45ϋϯζΦϯʢ෼ʣ

    View full-size slide

  3. ࣗݾ঺հʢ෼ʣ
    ࢀՃऀͦΕͧΕͷࣗݾ঺հʢ෼ʣ
    (ݕఆ߹֨ߨ࠲ ෼

    ./*45ϋϯζΦϯʢ෼ʣ

    View full-size slide

  4. ࣗݾ঺հʢ෼ʣ
    ࢀՃऀͦΕͧΕͷࣗݾ঺հʢ෼ʣ
    (ݕఆ߹֨ߨ࠲ ෼

    ./*45ϋϯζΦϯʢ෼ʣ

    View full-size slide

  5. ࢯ໊ʢϋϯυϧωʔϜՄʣ
    झຯ
    ࠓ೔ͷே͝͸Μ͸ԿΛ৯΂·͔ͨ͠ʁ
    ࢀՃऀࣗݾ঺հ

    View full-size slide

  6. ࣗݾ঺հʢ෼ʣ
    ࢀՃऀͦΕͧΕͷࣗݾ঺հʢ෼ʣ
    (ݕఆ߹֨ߨ࠲ ෼

    ./*45ϋϯζΦϯʢ෼ʣ

    View full-size slide

  7. (ݕఆ߹֨ߨ࠲
    θωϥϦετʹ͍ͭͯ
    (ݕఆ֓ཁઆ໌ʢఆٛɾࢼݧ಺༰ʣ
    ୈ̒ষʢσΟʔϓϥʔχϯάͷख๏ʣ

    View full-size slide

  8. ࠓޙधཁ͕ߴ·Δ"*ਓࡐͷখ࿩
    ʮ"*ΤϯδχΞʹݶΒͣͰ͕͢ɺ


    ࠓɺݱ৔ʹ଍Γͳ͍ͷ͸
    θωϥϦετͱͯ͠׆༂Ͱ͖Δਓ


    ͩͱ͍͏͜ͱ͕Α͘ݴΘΕ͍ͯ·͢ɻΞϧΰϦζϜɺΤϯδχΞϦϯάɺϏδ
    ωεɺͦͷ͢΂ͯͷ෼໺ͰೳྗΛൃشͰ͖Δਓ͕ٻΊΒΕ͍ͯΔΑ͏Ͱ͢ɻʯ
    CZגࣜձࣾϝϧΧϦɹ"*ΤϯδχΞɹদԬྰԻ͞Μ
    IUUQTUZQFKQFUGFBUVSF

    View full-size slide

  9. IUUQTUZQFKQFUGFBUVSF
    (ݕఆͷ֓ཁઆ໌ఆٛ
    (ݕఆͱ͸ʁ
    ɹ"*δΣωϥϦετΛഉग़͢ΔͨΊͷݕఆͷ͜ͱ
    ɹ"*δΣωϥϦετͱ͸ʁ
    ɹʰσΟʔϓϥʔχϯάͷجૅ஌ࣝΛ༗͠ɺద੾ͳ׆༻ํ਑Λܾఆ͠
    ͯࣄۀԠ༻͢ΔೳྗΛ࣋ͭਓࡐʱʢ+%-"ެࣜ)1ʣ

    View full-size slide

  10. (ݕఆͷ֓ཁઆ໌ࢼݧ֓ཁ
    JDLAެࣜHP
    ެࣜHPΛࢀর͠·͠ΐ͏ʂ

    View full-size slide

  11. (ݕఆͷ֓ཁઆ໌ࢼݧ֓ཁ
    ࣌ؒ͸ΊͬͪΌݫ͍͠
    ݸͷ໰୊Λ෼Ͱղ౴͢Δʹ໰ʹ͔͚ΒΕΔฏۉ࣌ؒ͸໿ඵ
    ὎҉ه໰୊͸ଈ౴Ͱ͖ΔϨϕϧʹ͠Α͏ʂ
    ˑ5*14
    ɹ͢΂ͯͷ໰୊ʹ͸νΣοΫϘοΫε͕ଘࡏ͠·͢ɻ
    ɹগ͠Ͱ΋೰Μͩ໰୊͸νΣοΫͯ͠ޙճ͠ʹͯ͠͠·͓͏ʂ

    View full-size slide

  12. (ݕఆͷ֓ཁઆ໌ࢼݧ֓ཁ
    ໰୊΋ݫ͠Ί
    ؙ҉هͰ͸͢΂ͯʹ౴͑ΒΕͳ͍ɻ
    σΟʔϓϥʔχϯάʹؔͯ͠͸ಛʹཧղΛਂΊ͍ͨͱ͜Ζɻ
    ˑ5*14
    ɹେ·͔ͳ໰୊ߏ੒͸ͪ͜Βɻ
    ɹਓ޻஌ೳͷجૅ஌ࣝʢୈষʙୈষʣɹɹׂ
    ɹσΟʔϓϥʔχϯάʢୈষʙୈষʣɹɹׂ
    ɹ࢈ۀ΁ͷԠ༻ɾ࣌ࣄ໰୊ʢୈষʙୈষʣׂ

    View full-size slide

  13. ࣗݾ঺հʢ෼ʣ
    ࢀՃऀͦΕͧΕͷࣗݾ঺հʢ෼ʣ
    (ݕఆ߹֨ߨ࠲ ෼

    ./*45ϋϯζΦϯʢ෼ʣ

    View full-size slide

  14. ׆ੑԽؔ਺
    ֶश཰ͷ࠷దԽ
    ߋͳΔςΫχοΫ
    $//৞ΈࠐΈχϡʔϥϧωοτϫʔΫ
    3//ϦΧϨϯτχϡʔϥϧωοτϫʔΫ
    ਂ૚ڧԽֶश
    ਂ૚ੜ੒Ϟσϧ
    (ݕఆ߹֨ߨ࠲
    ୈ6ষ:σΟʔϓϥʔχϯάͷख๏
    ׆ੑԽؔ਺
    ֶश཰ͷ࠷దԽ
    ߋͳΔςΫχοΫ
    $//৞ΈࠐΈχϡʔϥϧωοτϫʔΫ

    View full-size slide

  15. ׆ੑԽؔ਺
    ֶश཰ͷ࠷దԽ
    ߋͳΔςΫχοΫ
    $//৞ΈࠐΈχϡʔϥϧωοτϫʔΫ

    View full-size slide

  16. ׆ੑԽؔ਺
    ύʔηϓτϩϯʹΑΔܭࢉ
    ೖྗ૚ தؒ૚ ग़ྗ૚
    IUUQTUPLFJOFUOFVSBMOFUXPSLBDUJWBUJPO@GVODUJPO
    ׆ੑԽؔ਺ʹΑΔܭࢉ
    ׆ੑԽؔ਺

    View full-size slide

  17. ׆ੑԽؔ਺ͷ໾ׂ
    ϞσϧͷදݱྗΛ૿΍͢
    ͜Μͳͷ΋ࣅ߹͏
    Μ͡Όͳ͍͔͠Β

    View full-size slide

  18. εςοϓؔ਺
    IUUQTUPLFJOFUOFVSBMOFUXPSLBDUJWBUJPO@GVODUJPO
    ৘ใͷϩε͕ܹ͘͠
    දݱྗʹ๡͍͠ͷ͕ܽ఺

    View full-size slide

  19. IUUQTOFXUFDIOPMPHZMJGFTUZMFOFU&&"&#&"&&'&&#&&""&&###&"&$&"&#&"&"'
    γάϞΠυؔ਺
    ೖྗͨ͠஋͕େ͖͚Ε͹େ͖͍΄Ͳʹ͖ۙͮɺ
    ೖྗͨ͠஋͕খ͚͞Ε͹খ͍͞΄Ͳʹۙͮؔ͘਺ɻ
    ݩͷೖྗͷ஋Λࡴ͗͢͠ͳ͍ͱݴ͑Δɻ
    IUUQTUPLFJOFUOFVSBMOFUXPSLBDUJWBUJPO@GVODUJPO

    View full-size slide

  20. γάϞΠυؔ਺
    χϡʔϥϧωοτϫʔΫͰ༻͍ΒΕΔ׆ੑԽؔ਺͕ͩݱࡏ͸͋·
    Γ࢖ΘΕ͍ͯͳ͍ɻ
    γάϞΠυؔ਺Λ׆ੑԽؔ਺ͱͯ͠༻͍Δͱޯ഑ফࣦͱ͍͏ݱ৅
    ͕ى͜Γɺֶश͕ఀ଺ͯ͠͠·͏͜ͱ͕͋ΔͨΊɻ
    IUUQTJNBHJOHTPMVUJPOOFUEFFQMFBSOJOHNBUIFNBUJDTEFSJWBUJWFPGTJHNPJEGVODUJPO

    View full-size slide

  21. IUUQTUPLFJOFUOFVSBMOFUXPSLBDUJWBUJPO@GVODUJPO
    ιϑτϚοΫεؔ਺
    ग़ྗ૚Ͱ࢖ΘΕΔؔ਺ɻ
    Ұൠతʹ෼ྨ໰୊Ͱ࢖ΘΕΔɻ

    View full-size slide

  22. IUUQTTPOFPIBUFOBCMPHDPNFOUSZ
    UBOIؔ਺
    γάϞΠυؔ਺ΑΓ΋ਫ਼౓͕ग़΍͍͢΋ͷͷɺ͋͘·Ͱ΋ඍ෼ͷz࠷େ஋z
    ͕ʮ̍ʯͰ͋Γɺ̍ΑΓখ͍͞਺ʹͳͬͯ͠·͏έʔε͕΄΅શͯɻ

    ਂ͍ωοτϫʔΫͰ͸ɺޯ഑ফࣦ໰୊Λ๷͙͜ͱ͕೉͍͠ɻ

    View full-size slide

  23. ೖྗ͕ҎԼͳΒɺҎ্ͳΒͦͷ··ग़ྗ͢Δؔ਺ͷ͜ͱɻ
    ҎԼͷ਺ࣜͰදͤΔɻ
    ZNBY Y

    IUUQTUFDICMPHHNPBQKQ&"'&"#&"%"&#'&&"&#$&&"&#$&#&#&#&"&#%#'&'&$&#&'#"&$"$&"&""
    3F-6ؔ਺
    3F-6ؔ਺͸࠷΋Ұൠʹ༻͍ΒΕΔ׆ੑԽؔ਺ɻ

    ͭͷେ͖ͳಛ௃ɿ

    ޯ഑ফࣦ͕ى͜Γʹ͍͘

    ܭࢉ͠΍͍͢ͱ͍͏

    3F-6ؔ਺͸࠷΋׆ੑԽؔ਺ͱͯ͠࢖͍উख͕͍͍ͱ͞ΕΔɻ

    View full-size slide

  24. IUUQTTPOFPIBUFOBCMPHDPNFOUSZ
    3F-6ؔ਺
    Y͕ΑΓେ͖͍৔߹ɺඍ෼஋͸ৗʹ࠷େ஋Ͱ͋Δ͕ಘΒΕΔɻ
    ὎ޡࠩٯ఻೻ͷࡍʹޯ഑͕খ͘͞ͳΓʹ͍͘

    ʢޯ഑ফࣦ͠ʹ͍͘ʣ

    View full-size slide

  25. ׆ੑԽؔ਺
    ֶश཰ͷ࠷దԽ
    ߋͳΔςΫχοΫ
    $//৞ΈࠐΈχϡʔϥϧωοτϫʔΫ

    View full-size slide

  26. ޯ഑߱Լ๏
    ඍ෼Λ׆༻͢Δ͜ͱʹΑͬͯɺ
    Ϟσϧͷ༧ଌ஋ͱ

    ࣮ࡍͷ஋ʢຊ౰ͷਖ਼ղʣ
    ͱͷޡࠩΛͳ͍ͯ͘͘͠ɻ
    ͦͷΞϓϩʔνΛ࣮ݱ͢Δख๏ʹ

    ޯ഑߱Լ๏

    View full-size slide

  27. ޯ഑߱Լ๏
    IUUQXXXQMBODWUJUFDIBDKQGVLVEBMBCCBDCEEBCDCBGDDGDQEG
    ֶश཰Λ͏·ʙ͘ௐ੔͢Δ͜ͱ͕େ੾⭐
    ޯ഑߱Լ๏ͷߟ͑ํ˰্͔ΒϘʔϧΛམͱ͠Ұ൪௿͍ͱ͜Ζ΁୧Γண͘·Ͱ଴ͭ
    େҬ࠷దղʹຊ౰ͷ࠷దղ
    ہॴ࠷దղʹݟ͔͚ͤͷ࠷దղ

    View full-size slide

  28. ޯ഑߱Լ๏
    ࣌ࠁ𝑡Ͱ𝝎 𝑡
    ʹ͋ͬͨϘʔϧΛޯ഑ͷٯํ޲΁ಈ͔͢ࡍͷϧʔϧ
    𝝎(𝑡+1) = 𝝎(𝑡) + ∆𝝎(𝑡) , ∆𝝎(𝑡) = −𝜂𝛻𝐸 𝝎 𝑡 (4.9)
    𝑡 lͱॱ࣍܁Γฦ͢͜ͱͰɼޡࠩؔ਺άϥϑͷఈ΁߱Γ͍ͯ͘
    ˎ̍εςοϓͷҠಈڑ཭∆𝝎 𝑡
    ͸lֶश཰z𝜂Ͱܾఆ͞ΕΔ
    IUUQXXXQMBODWUJUFDIBDKQGVLVEBMBCCBDCEEBCDCBGDDGDQEG

    View full-size slide

  29. ޯ഑߱Լ๏
    ˎ̍εςοϓͷҠಈڑ཭

    ʮޯ഑ʹԊͬͯҰ౓ʹͲΕ͚ͩ߱Γ͍͔ͯ͘ʯ

    lֶश཰zʢϋΠύʔύϥϝʔλʣ

    View full-size slide

  30. ޯ഑߱Լ๏
    ֶश཰ͷऔΓํ͸τϥΠΞϯυΤϥʔʹجͮ͘
    w ֶश཰͕େ͖͍

    ˰ࠁΈ͕ߥ͗ͯ͢ޡࠩؔ਺ͷܗঢ়Λଊ͑ΒΕͣɼऩଋ͠ͳ͍

    w ֶश཰͕খ͍͞

    ˰ֶश͕Ұ޲ʹਐߦ͠ͳ͍
    IUUQXXXQMBODWUJUFDIBDKQGVLVEBMBCCBDCEEBCDCBGDDGDQEG

    View full-size slide

  31. ࣗݾ঺հ
    IUUQTRJJUBDPN)JSPLJYJUFNTBBCEE

    View full-size slide

  32. ϋΠύʔύϥϝʔλ
    ʁʁʁϋΠύʔύϥϝʔλʁʁʁ
    IUUQTYOUKBBORKNKUGQDKEDPN&&##"&#&"&"#&$"$&#&"&"&&&&'#$&&"#&#"&'&$&&"&"&&'

    View full-size slide

  33. ׆ੑԽؔ਺
    ֶश཰ͷ࠷దԽ
    ߋͳΔςΫχοΫ
    $//৞ΈࠐΈχϡʔϥϧωοτϫʔΫ

    View full-size slide

  34. υϩοϓΞ΢τ
    Θͨ͠ͷλʔϯʂ

    ຐ๏Χʔυɹ
    lΦʔόʔϑΟοςΟϯάz
    IUUQTCPLFUFKQCPLF
    ͋͞ɺ࢝ΊΔΘΑɻ
    ҋͷήʔϜΛɾɾɾ

    View full-size slide

  35. υϩοϓΞ΢τ
    ͦ͜·Ͱͩ;&ͬˑ
    Θͨ͠͸

    ਓ޻஌ೳքͷࢧ഑ऀʹͳΔͷΑ


    ୭ʹ΋अຐͤ͞ͳ͍Θɾɾɾ

    View full-size slide

  36. υϩοϓΞ΢τ
    τϥοϓΧʔυൃಈʂ
    lυϩοϓΞ΢τ
    IUUQTNBUPNFOBWFSKQPEBJ

    View full-size slide

  37. χϡʔϩϯΛϥϯμϜʹυϩοϓΞ΢τ͠ɺ

    ΦʔόʔϑΟοςΟϯάΛ๷͙
    IUUQTRJJUBDPNNJOFJUFNTECBCCFGD
    υϩοϓΞ΢τ

    View full-size slide

  38. ςετσʔλʹର͢Δޡࠩؔ਺ͷ্͕Γ࢝Ί
    ʹଧͪ੾Γʹ࠷దͳλΠϛϯάͱݟͳ͢
    FBSMZTUPQQJOH
    ֶशΛૣΊʹଧͪ੾Δख๏
    ./*45ϋϯζΦϯͰ֬ೝ͠·͢ʂ

    View full-size slide

  39. σʔλͷਖ਼نԽ
    ֤ಛ௃ྔΛdͷൣғʹม׵͢Δॲཧ
    ./*45ϋϯζΦϯͰ֬ೝ͠·͢ʂ

    View full-size slide

  40. σʔλͷඪ४Խ
    ඪ४Խ͢ΔͱԿ͕ྑ͍ͷ͔ʁ

    View full-size slide



  41. ׆ੑԽؔ਺
    ֶश཰ͷ࠷దԽ
    ߋͳΔςΫχοΫ
    $//৞ΈࠐΈχϡʔϥϧωοτϫʔΫ

    View full-size slide

  42. $//ͱ͸
    ը૾σʔλʹదͨ͠ܗͷ

    χϡʔϥϧωοτϫʔΫ
    ը૾Λͦͷ··ͷܗʹ̎࣍ݩͰ

    ѻ͏͜ͱ͕Ͱ͖Δ
    $POWPMVUJPOBM/FVSBM/FUXPSL

    View full-size slide

  43. $//ʢશମ૾ʣ
    $//͸ɺ৞ΈࠐΈ΍ϓʔϦϯάʹΑͬͯಘΒΕͨಛ௃Ϛοϓͷ֤ϐΫηϧσʔλΛɺ

    χϡʔϥϧωοτϫʔΫͷೖྗ஋ͱͯ͠ར༻͢Δɻ
    IUUQTXXXBUNBSLJUDPKQBJUBSUJDMFTOFXTIUNM

    View full-size slide

  44. $// ৞ΈࠐΈ

    IUUQTULFOHPHJUIVCJPCMPHVOEFSTUBOEJOHDPOWPMVUJPOBMOFVSBMOFUXPSLTGPSOMQ



    Χʔωϧ

    ʢϑΟϧλʔʣ

    View full-size slide

  45. $// ϓʔϦϯά

    IUUQTULFOHPHJUIVCJPCMPHVOEFSTUBOEJOHDPOWPMVUJPOBMOFVSBMOFUXPSLTGPSOMQ
    ಛ௃Ϛοϓͷ࠷େ஋Λநग़͠ɺ

    ը૾αΠζΛܾΊΒΕͨϧʔϧʹैͬͯ

    খ͘͢͞Δ
    NBYϓʔϦϯά

    View full-size slide

  46. $// શ݁߹૚

    ग़ྗͷܗΛ̍࣍ݩʹมܗ͢Δ
    ௨ৗͷχϡʔϥϧωοτϫʔΫͱಉ͡

    ʮӅΕ૚ʯʮग़ྗ૚ʯʹ઀ଓ͠ɺ

    View full-size slide

  47. ࣗݾ঺հʢ෼ʣ
    ࢀՃऀͦΕͧΕͷࣗݾ঺հʢ෼ʣ
    (ݕఆ߹֨ߨ࠲ ෼

    ./*45ϋϯζΦϯʢ෼ʣ

    View full-size slide

  48. ./*45ͱ͸
    ./*45ͱ͸ɺը૾σʔληοτͷ͜ͱɻ

    ʢखॻ͖਺ࣈը૾ ຕͱɺςετը૾ ຕΛूΊͨ΋ͷʣ

    ҎԼ͕ϖΞʹͳ͍ͬͯΔɻ

    खॻ͖ͷʙͷ਺ࣈ͕ॻ͔Εͨը૾σʔλͱɺ

    ͦͷը૾ʹॻ͔Ε࣮ͨࡍͷ਺ࣈσʔλ

    View full-size slide

  49. ./*45ͱ͸
    IUUQTXFCMBCPPTDBTJFSSBOFUQZUIPOLFSBTNOJTUTBNQMFIUNM
    σʔλͷ༷ࢠ

    View full-size slide

  50. ./*45ͱ͸
    IUUQTXFCMBCPPTDBTJFSSBOFUQZUIPOLFSBTNOJTUTBNQMFIUNM
    ग़ྗ͸͜Μͳײ͡
    ਺ࣈ ֬཰
    0 0.014
    1 0.001
    2 0.013
    3 0.719
    4 0.034
    5 0.016
    6 0.023
    7 0.065
    8 0.086
    9 0.029

    View full-size slide

  51. Ͱ͸ɺ΍ͬͯΈ·͠ΐ͏
    ࣮૷

    View full-size slide

  52. 4FRVFOUJBMϞσϧ
    IUUQNBSVQFLFDPN*,%"%7@%-@/P@,FSBTIUNM

    View full-size slide