Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
RubyでChainerつくってます!!
Search
hatappi
March 30, 2019
Technology
1.5k
2
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
RubyでChainerつくってます!!
Chainer Meetup #09
#chug_jp
hatappi
March 30, 2019
More Decks by hatappi
See All by hatappi
メルカリのグローバルアプリで挑んだ AlloyDB 運用と課題解決の実践記
hatappi
0
280
AlloyDB 奮闘記
hatappi
0
490
Cloudflare を活用して変わったメルカリの開発体験 / How Cloudflare Changed Mercari's Development Experience
hatappi
1
920
RubyではじめるGraphQL
hatappi
0
970
TDDな個人開発
hatappi
0
380
できるだけ楽して楽しくRails開発しよう
hatappi
2
390
EKSにRailsをのせた
hatappi
1
1.3k
RubyとApache Arrow
hatappi
0
2.7k
Red Chainerを なぜ作って今後どうするのか
hatappi
2
2.5k
Other Decks in Technology
See All in Technology
module Synths; end
asonas
1
130
GoにおけるFFIのこれまでとこれから
goccy
5
2.3k
スクラムで身についていた動き方を、XPで捉え直してみた
codmoninc
PRO
1
350
AI活用の現在地、 ちゃんと見えてますか?/XPfest-2026
visional_engineering_and_design
0
180
Gitは怖い?共有ワークスペースから始めるSnowflakeチーム開発
coco_se
0
110
When Does a Local Qwen Start to Break
morshoto
0
200
The Agent Builder Loop from Daily Work to OSS
minorun365
PRO
3
120
omasushiというライブラリを作った
polidog
PRO
0
190
AI-DLCって実際どう? 〜聞きたいこと全部聞いてみる〜
news_it_enj
0
260
「重なり」は迎える側がつくる ― 人もAIエージェントも歓迎するプロダクトエンジニアリング ―
go0517go
PRO
0
280
Amazon S3 Tablesに全部任せてみた結果——コンパクション/スナップショット管理は本当に手放せるか
shigeruoda
1
460
Snowflakeで実現する全社横断の顧客の声(VOC)分析・活用基盤@Snowflake World Tour Tokyo 2026
yuto16
0
160
Featured
See All Featured
Lessons Learnt from Crawling 1000+ Websites
charlesmeaden
PRO
1
1.6k
Digital Projects Gone Horribly Wrong (And the UX Pros Who Still Save the Day) - Dean Schuster
uxyall
1
2.8k
Discover your Explorer Soul
emna__ayadi
2
1.3k
Tips & Tricks on How to Get Your First Job In Tech
honzajavorek
1
730
Site-Speed That Sticks
csswizardry
13
1.5k
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
280
Visualization
eitanlees
152
17k
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
450
WCS-LA-2024
lcolladotor
0
820
How People are Using Generative and Agentic AI to Supercharge Their Products, Projects, Services and Value Streams Today
helenjbeal
1
310
B2B Lead Gen: Tactics, Traps & Triumph
marketingsoph
0
240
From π to Pie charts
rasagy
0
360
Transcript
RubyͰChainerͭͬͯ͘·͢!! @Chainer Meetup #9
2 • Yusaku Hatanaka • Merpay Inc. • Backend Engineer
• GoΛॻ͍͍ͯΔ͜ͱ͕ଟ͍ • ϓϥΠϕʔτ • RubyΛॻ͍͍ͯΔ͜ͱ͕ଟ͍ • Anket: RailsΛͬͨSlackͷΞϯέʔταʔϏε • Red Chainer: ʁʁʁʁ ↑ࠓ͜ͷΛ͠·͢ self introduction @hatappi
3 Red Chainer??
4 + Chainer
5 Red Chainer
6 • Rubyのための深層学習フレームワーク • GitHub: red-data-tools/red-chainer • PythonでかかれたChainerをRubyへポーティング Red Chainer
ͱ? Chainer Red Chainer NumPy Numo::NArray (ruby-numo/numo-narray) CuPy cumo (sonots/cumo)
7 ✓ Activation Relu, Sigmoid, LeakyReLU, LogSoftmax, Tanh ✓ loss
SoftMaxEntropy, MeanSquaredError ✓ noise Dropout ✓ Normalization BatchNormalization ✓ Pooling AveragePooling2D, MaxPooling2D ✓ etc Chainerͷఏڙ͢ΔVariableTrainerͳͲ ͷ֤छAPIΛ༻ҙ͍ͯ͠·͢ ݱঢ়Կ͕Ͱ͖Δͷ͔ ֤छAPIͷఏڙ αϯϓϧ ✓ MNIST ✓ CIFAR 10, 100 ✓ Iris
8 ͳͥRed Chainer Λ࡞Γ͡Ίͨͷ͔
ある⽇ Red Data Tools という プロジェクトに出会う
10 Red Data Tools • Ruby⽤のデータ処理ツールを提供するプロジェクト • 2017年2⽉に発⾜ • 活動例
• Apache Arrow本体への開発の参加やRubyのbinding • Charty, Red Datasets, Red Chainer, etc • 毎⽉1回のオフラインMeetupをやっている • 次回は4/9!! • https://speee.connpass.com/event/124079/ https://red-data-tools.github.io/ja/
11 Red Data Tools Policy 1. Collaborate across the Ruby
community 2. Acting rather than blaming 3. Continuous, iterative progress rather than a short, big project 4. The current lack of knowledge doesn't matter 5. Ignore criticism from outsiders 6. Fun!
参加するのは良いけど ⾃分は何をしよう
Rubyで深層学習ができたら ⾯⽩いのでは
ただそれだけですw
15 Ͳ͏ͬͯ ϙʔςΟϯάͨ͠ͷ͔
16 2017/08 2017/10 2018/05 2019/03 Red Chainer ͷྺ࢙
17 2017/08 First Commit 2017/10 2018/05 2019/03 Red Chainer ͷྺ࢙
18 First Commit 2017/08
19 First Commit • Chainer v2ͷίʔυΛͻͨ͢ΒಡΉ • Python΄ͱΜͲॻ͍ͨ͜ͱͳ͍ͷͰPythonͷυΩϡϝϯτಡ Έͳ͕Βͻͨ͢ΒϙʔςΟϯά •
ྫ͑࠷ॳˣ͕ͲΜͳڍಈʹͳΔ͔͔ΒͣυΩϡϝϯτ ΛಡΉͳͲ͢ΔͨΊ͕͔͔࣌ؒΔ • ͳΕͯ͘Δͱ಄ͷதͰมͰ͖ΔΑ͏ʹͳΔ
20 2017/08 First Commit 2017/10 2018/05 2019/03 Red Chainer ͷྺ࢙
21 2017/08 First Commit 2017/10 First release 2018/05 2019/03 Red
Chainer ͷྺ࢙
22 First Release • Multi Layer Perceptron(MLP)ʹඞཁͳ࠷ݶͷAPIΛαϙʔτ • ಈ͘ͷ͕Ͱ͖ͨʂʂ
DEMO
24
25 2017/08 First Commit 2017/10 First release 2018/05 2019/03 Red
Chainer ͷྺ࢙
26 2017/08 First Commit 2017/10 First release 2018/05 ΈࠐΈԋࢉΛαϙʔτ 2019/03
Red Chainer ͷྺ࢙
27 ΈࠐΈԋࢉͷαϙʔτ • ը૾ࣝผ͍ͨ͠ʂʂʂ • BatchNormalization, Pooling, etc.. ͳͲͷAPIΛՃ •
CIFAR-10, 100ͷαϯϓϧͷՃ • ϞσϧVGG, ResNet18 • ՄࢹԽͨ͘͠ͳΔ • ྫ͑ը૾ࣝผΛRed ChainerͰߦͬͯepoch͝ͱͷਫ਼ΛՄ ࢹԽ͍ͨ͠
DEMO
29 1epoch 45epoch
30 2017/08 First Commit 2017/10 First release 2018/05 ΈࠐΈԋࢉΛαϙʔτ 2019/03
Red Chainer ͷྺ࢙
31 2017/08 First Commit 2017/10 First release 2018/05 ΈࠐΈԋࢉΛαϙʔτ 2019/03
Chainer 3ܥͷରԠ Red Chainer ͷྺ࢙
32 Chainer 3ܥͷରԠ • Chainer3ܥͰऔΓࠐ·ΕͨPRΛͬ͟ͱݟͯͲΜ ͳରԠ͕ඞཁ͔ΛѲ͢Δ • ChainerͷGithub releasesݟͯ͘͢ॿ͔Γ ·ͨ͠
• 11࣌ؒ͘Β͍͔͕࣌ؒ͠ͱΕͳ͍ͷͰ Trello Ͱཧͭͭ͠Εͳ͍Α͏ʹ͠ͳ͕Βਐḿͤ͞ Δ
33 ͿͬͪΌ͚͑Δͷʁ
34 ͿͬͪΌ͚͑Δͷʁ MNIST (epoch: 20, unit: 1000, batchsize: 100) શepochʹ͔͔ͬͨඵ
0 2000 4000 6000 8000 Numo::NArray Numo::NArray with OpenBLAS numpy 408.025 s 784.824 s 7415.42 s
35 ໘ͷ՝ • ෦ͷॲཧͰແବͳ෦͕ͳ͍͔ௐ͕ࠪඞཁ • NumPyʹ͋ͬͯNumo::NArrayʹͳ͍ϝιουΛҰ෦Ruby ͷੈքʹ͖͍ͬͯͯΔ(Arrayʹมͯ͠ॲཧ͍ͯ͠Δ)ͷͰ Numo::NArrayͰ݁Ͱ͖ΔΑ͏ʹ͢Δ • ͳͲͳͲվળͰ͖Δͱ͜Ζ͋Γͦ͏
• ͡ɺ͔͡Μ͕ɻɻɻ
36 ࠓޙʹ͍ͭͯ • 4ܥରԠ͍͖ͯ͠·͢$ • ONNX͕͑ΔΑ͏ʹͳΓ͍ͨ <= ࠓணख͠͡Ίͯ·͢ • ONNX
• open neural network exchange format • ྫ͑ChainerͰֶशͨ͠ϞσϧΛMXNetͰऔΓࠐΜͰ ͏͜ͱ͕ग़དྷΔ • Red ChainerͰ͑ΔΑ͏ʹͳΕطଘͷࢿ࢈Λ͏͜ͱ ͕Ͱ͖ΔͷͰخ͍ͣ͠
37 ·ͱΊ
38 ·ͱΊ • RubyͰChainerΛ࡞ͬͯ·͢ • v2͔ΒϙʔςΟϯάͯ͠࠷ۙv3ʹରԠ͠·ͨ͠ • ໘ͷ՝͋ΔͷͰվળ͍ͨ͠ • ONNX໘നͦ͏ͳͷͰΓ͍ͨ
• ࠓޙ։ൃଓ͚Δ༧ఆͳͷͰஆ͔͍Ͱݟक͍͚ͬͯͨͩΔ ͱخ͍͠Ͱ͢