Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
pytorchで機械学習しない
Search
Hata Ryosuke
October 21, 2019
Technology
3
940
pytorchで機械学習しない
pytorchでマクローリン展開とニュートン法を試してみました。
Hata Ryosuke
October 21, 2019
Tweet
Share
More Decks by Hata Ryosuke
See All by Hata Ryosuke
関西Kaggler会 発表スライド
ryosukehata
1
870
Monocular 3D Object Detection Survey
ryosukehata
3
440
量子情報勉強会,量子ゲートについて
ryosukehata
0
210
Other Decks in Technology
See All in Technology
いざ、BSC討伐の旅
nikinusu
2
780
【令和最新版】AWS Direct Connectと愉快なGWたちのおさらい
minorun365
PRO
5
750
SREによる隣接領域への越境とその先の信頼性
shonansurvivors
2
520
Engineer Career Talk
lycorp_recruit_jp
0
170
Amazon CloudWatch Network Monitor のススメ
yuki_ink
1
210
AWS Lambdaと歩んだ“サーバーレス”と今後 #lambda_10years
yoshidashingo
1
170
OCI Network Firewall 概要
oracle4engineer
PRO
0
4.1k
スクラム成熟度セルフチェックツールを作って得た学びとその活用法
coincheck_recruit
1
140
SREが投資するAIOps ~ペアーズにおけるLLM for Developerへの取り組み~
takumiogawa
1
260
Amazon Personalizeのレコメンドシステム構築、実際何するの?〜大体10分で具体的なイメージをつかむ〜
kniino
1
100
20241120_JAWS_東京_ランチタイムLT#17_AWS認定全冠の先へ
tsumita
2
270
適材適所の技術選定 〜GraphQL・REST API・tRPC〜 / Optimal Technology Selection
kakehashi
1
460
Featured
See All Featured
Put a Button on it: Removing Barriers to Going Fast.
kastner
59
3.5k
The Illustrated Children's Guide to Kubernetes
chrisshort
48
48k
Faster Mobile Websites
deanohume
305
30k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
131
33k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
126
18k
The MySQL Ecosystem @ GitHub 2015
samlambert
250
12k
Visualization
eitanlees
145
15k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
Into the Great Unknown - MozCon
thekraken
32
1.5k
The Straight Up "How To Draw Better" Workshop
denniskardys
232
140k
Making the Leap to Tech Lead
cromwellryan
133
8.9k
The Power of CSS Pseudo Elements
geoffreycrofte
73
5.3k
Transcript
pytorchͰػցֶश͠ͳ͍ ػցֶश/Kaggle͘͘ձ#10ˏ େࡕ(10/21 19:00ʙ) ാɹྒྷհ
͜͡͠ΐ͏͔͍ twitter (@hattan0523) ϝʔΧʔۈ ීஈ$"%ϙνϙνͯ͠ɼ ͦΕͬΆ͍ਤΛग़͢ਓ ɹɹʢ෩ͷͱ͖ʹΨϥεʹςʔϓషΔ͖ͱ͔ܭࢉ͢ΔɻͲΜͳਤͰ࡞Ε·͢ʣ ػցֶशओۀͰ͋Γ·ͤΜ େֶ࣌ʹྔࢠޫֶͷݚڀʹूத͠ɼ
ໟΛࣦ͍ത࢜Λऔಘɻ http://www.breault.com/software/asap-nextgen https://www.muratasoftware.com/products/ examples/watgal004/
ಈػ pytorchͱ͔ਂֶशͷϥΠϒϥϦɼ ίϯϖʹ͍ͬͺ͍ΘΕͯΔ͠ ը૾ͱ͔NLPͷਂֶशΛΔͱ͖ ͱΓ͋͑ͣͬͱ͖Ό͑͑Ζɻ https://twitter.com/nino_pira/status/1181913845507354626
ಈػ pytorchԿΛͬͯΔͷʁ ͡Ͳ͏ͼͿΜʁ ͠Μͦ͏͕͘͠ΎʔͷϥΠϒϥϦͰʁ ͦ͏ͩʂ ඍΛ͠Α͏ʂ
ࠓճɿࣗಈඍΛͬͯܭࢉ ϚΫϩʔϦϯల։ sinؔΛ10࣍·Ͱ sinؔΛ20࣍·Ͱ χϡʔτϯ๏ɹɹɹɹɹɹɹɹͷղΛग़͢
ࣗಈඍ is Կʁ https://github.com/pytorch/pytorch/blob/edb88b5f3af03718b443d015f195faa1832ce95b/caffe2/operators/sin_op.cu ɾඍ ࣮ࡍʹಋؔͷఆٛʹैͬͯతʹܭࢉ͢Δɻ ޡ͕ࠩͰ͖Δɻ ɾࣗಈඍ ܭࢉ͢ΔؔͷಋؔΛ༧Ίఆ͓ٛͯ͘͠ɻ ؔʹೖ͢Δ͚ͩͳͷͰޡࠩ΄΅ͳ͍ɻ
pytorchͷsinͷಋؔͷఆٛ ֻ͚ͷͱ͜ΖΛݟΔͱɼ ಋؔ(cos)͕ఆٛ͞Ε͍ͯΔ ͜ͱ͕Θ͔Δɻ ࢀߟɿࣗಈඍΛ࣮ͯ͠ཧղ͢Δ https://qiita.com/lotz/items/39c52f08cc9b5d8439ca https://qiita.com/lotz/items/f1d4ab1d83dc13a5d81a
ͬͯΈΔ ී௨ʹΈͳ͞Μ͕࣮ߦ͍ͯ͠Δ͜ͱɻ requires_grad=Trueͱ͢Δ͜ͱͰɼඍ͢ΔΑʔͬͯએݴ͢Δɻ backward()ͰܭࢉάϥϑʹԊͬͯࣗಈඍ͕ݺͼग़͞Εɼ x.gradͰඍ͕ಘΒΕ·͢ɻ ࢀߟɿPyTorchͰߴ֊ภඍ (https://qiita.com/tmasada/items/ 9dee38e5bc1482217493)
ೋ֊ඍ ‘torch.autograd.grad(f, x, create_graph=True)’Ͱɼfʹ͍ͭͯxͰඍ ͢ΔΑʔͱએݴ͢Δɻ ܭࢉάϥϑΛ࡞Βͳ͍ͱඍͯ͘͠Εͳ͍ɻ ࡉ͔͍͜ͱ্ͷQiitaͷهࣄͰɻ ࢀߟɿPyTorchͰߴ֊ภඍ (https://qiita.com/tmasada/items/ 9dee38e5bc1482217493)
ԿճͰඍͰ͖·͢ʂ ࢀߟɿPyTorchͰߴ֊ภඍ (https://qiita.com/tmasada/items/ 9dee38e5bc1482217493) ඍ͕Ͱ͖ΔʂͰ͖Δͧʂʂ
ϚΫϩʔϦϯల։ Β͔ͳؔΛ্ͷΑ͏ͳܗʹల։ͯ͠ɼ ۙࣅతͳؔͱͯ͠ද͢͜ͱ͕Ͱ͖Δɻ ֶಘҙ͡Όͳ͍ͷͰɼ ݫີͳఆٛΑ͘Θ͔͍ͬͯ·ͤΜɻ ͜ΕΛpytorchͰ࣮ͯ͠ΈΑ͏ʂ (kaggleͷnotebookࢀর)
sinؔͰಘΒΕͨάϥϑ ͬͨ͜ͱ 1.ҙͷ࣍·ͰܭࢉάϥϑΛ࡞ͯ͠ɼඍΛܭࢉ͢Δ 2.֤ԣ࣠ͷʹରͯ͠ܭࢉͨ͠ඍͰॎ࣠ͷΛग़͢ɻ େมͳͷͰ1,2ΛߦྻͰܭࢉ͢Δ sinؔΛ10࣍·Ͱ sinؔΛ20࣍·Ͱ https://www.kaggle.com/hattan0523/pytorch-maclaurin-series? scriptVersionId=22206309
χϡʔτϯ๏ ඍΛͬͯํఔࣜΛղ͘ํ๏ ʹ͍ͭͯࣗಈඍΛͬͯղ͍ͯΈΔɻ ղ x=ln2≒0.69314718056 C++ - ඇઢܗํఔࣜͷղ๏ʢχϡʔ τϯ๏ʣʂ https://www.mk-mode.com/blog/
2012/11/21/21002047/# ΑΓҾ༻
σϞ̎ɿ݁Ռ ࣮ίʔυ: https://www.kaggle.com/hattan0523/newton-raphson-method-by- pytorch ղ x=ln2≒0.69314718056 ॳظͱؔΛ༩͑ΕɼҙͷճܭࢉΛߦͬͯ͘ΕΔɻ ֓ͶऩଋͰ͖ͨʂ
·ͱΊ ɾpytorchࣗಈඍͷϥΠϒϥϦ Ͱ͌ʔΒʔʹΜ͙Ͱͳͦ͞͏ɻ ɾܭࢉάϥϑΛ໌ࣔతʹ࡞ͬͯ͋͛Δ͜ͱͰ ɹඍՄೳͳؔΛ͍ͬͯΖΜͳ༡ͼ͕Ͱ͖ͦ͏ɻ ɾྫͱͯ͠ɼ sinؔͷϚΫϩʔϦϯల։ χϡʔτϯ๏ΛͬͨํఔࣜͷղΛಋग़ͨ͠ɻ ɾඍָ͍͠ΊΔͬ