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
Topics about SciRuby @dcmodel/davis tutorial, Kobe
Search
domitry
February 12, 2016
Technology
0
190
Topics about SciRuby @dcmodel/davis tutorial, Kobe
domitry
February 12, 2016
Tweet
Share
More Decks by domitry
See All by domitry
The Elements of Statistical Learning 読書会 3.4章
domitry
0
270
PCで絵をかこう!
domitry
0
550
JavaScript&可視化講習会#1
domitry
1
650
精神は物理的に記述できるか
domitry
0
130
RubyとFortranの話
domitry
0
340
Nyaplot - a data visualization tool for Ruby
domitry
3
690
Nyaplotの紹介@U-22プロコン
domitry
1
160
D3.js入門
domitry
0
4.1k
3Dプリンタの使用感に関する考察
domitry
1
290
Other Decks in Technology
See All in Technology
RSNA2024振り返り
nanachi
0
500
まだ間に合う! エンジニアのための生成AIアプリ開発入門 on AWS
minorun365
PRO
4
580
APIファーストで実現する運用性の高い IoT プラットフォーム: SORACOMのアプローチ
soracom
PRO
0
240
Fintech SREの挑戦 PCI DSS対応をスマートにこなすインフラ戦略/Fintech SRE’s Challenge: Smart Infrastructure Strategies for PCI DSS Compliance
maaaato
0
450
Platform Engineeringは自由のめまい
nwiizo
4
1.9k
現場の種を事業の芽にする - エンジニア主導のイノベーションを事業戦略に装着する方法 -
kzkmaeda
2
1.5k
【Developers Summit 2025】プロダクトエンジニアから学ぶ、 ユーザーにより高い価値を届ける技術
niwatakeru
2
890
30分でわかる『アジャイルデータモデリング』
hanon52_
9
2.2k
技術負債の「予兆検知」と「状況異変」のススメ / Technology Dept
i35_267
1
1k
リアルタイム分析データベースで実現する SQLベースのオブザーバビリティ
mikimatsumoto
0
950
個人開発から公式機能へ: PlaywrightとRailsをつなげた3年の軌跡
yusukeiwaki
10
2.7k
2.5Dモデルのすべて
yu4u
2
610
Featured
See All Featured
Making Projects Easy
brettharned
116
6k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
12
950
Designing for humans not robots
tammielis
250
25k
Building Your Own Lightsaber
phodgson
104
6.2k
Testing 201, or: Great Expectations
jmmastey
41
7.2k
The World Runs on Bad Software
bkeepers
PRO
67
11k
How STYLIGHT went responsive
nonsquared
98
5.3k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
3.7k
Docker and Python
trallard
44
3.3k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
29
1k
How to train your dragon (web standard)
notwaldorf
90
5.8k
Code Reviewing Like a Champion
maltzj
521
39k
Transcript
SciRubyとか, 最近のRuby界隈の話 西田 直樹 (@domitry)
自己紹介Part1 • 大阪大学 基礎工… (略)… 生物工学コース 3年 • 来年卒論書きます
寝不足の方へ • 資料: http://naoki.pw/ruby • SciRuby Install battle > sudo
apt-get install ruby2 > gem install nyaplot > gem install iruby
1/3 IRubyとJupyterのお話
IRuby? Jupyter? • IRuby: 対話的Ruby実行環境, ブラウザ上 • Jupyter: これの上にIRubyが乗っかってる
==DEMO== • (nbviewerのURL)
何が便利? • R studioやMathematica, MATLABなど色々 あった • Webとつなげたのが新しい • 共有が楽,
interactive
使われてるの? • アメリカだと大学の授業で普通に使われてる – https://web.stanford.edu/~boyd/papers/cvx _short_course.html • 日本だとCookpadとか
Jupyterの歴史 • 2012年IPythonとしてスタート • 2014年分裂(IPython teamとJupyter team) • 1ヶ月後ぐらいにJupyterがIPythonを吸収(?) •
検索ワードは`hoge AND IRuby OR Jupyter OR IPython` ?
Jupyterのしくみ http://ipython.org/ipython-doc/3/
Jupyter kernel色々 • IPython • IJulia • IHaskell • IRuby
• ICommonLisp • Ibrainf*ck … etc.
kernelの作りやすさ • Ibrainf*ck – https://github.com/robbielynch/ibrainfuck • Making kernels for Jupyter
– https://github.com/ipython/ipython/wiki/I Python-kernels-for-other-languages
拡張の作りやすさ • completion(補完)機能をhookしたりできる。
IRubyの話 • http://github.com/SciRuby/iruby • IPython黎明期から存在 • 現メンテナ: @minad, @domitry •
割とがっつりメンテ継続中
IRubyの話 • 最近Nyaplot, Daru, GnuplotRBなど対応ライ ブラリが増える • ImageMagickとかもこの上で動く
==DEMO== • (ipynbのURL)
Jupyter/IRubyまとめ • Jupyterは向こうでは割と使われてる • いろんな言語で動く: Ruby, Python, Brainf*ck… • 何がうれしい?:
可視化や共有が楽
2/3 Nyaplotとか
Nyaplot (にゃぷろっと) • 「にゃ〜」+「プロット」 • 名前空間問題 • 猫みたいにかわいいグラフが作れる
猫が好き
Nyaplotとは • 汎用可視化ライブラリ • IRuby上で便利 • `gem install nyaplot`でインストール
Nyaplotのできること • 2D, 3D, 地図, circos風プロットまで • 主にSVGとWebGLで稼働 • 出力はPNGかSVG
==DEMO== • (.ipynbのURL)
Nyaplotのできないこと • Webから離れること • Headless browserを試したことあり • 最近Electronでやらない?という話が有る
Nyaplotの仕組み • RubyのコードでJSONを生成、JavaScriptに JSONを渡して描画してもらう • RubyはJSONをいじるだけ、JavaScriptは JSONを解釈するだけ
Nyaplotjs • 単独で動く • portingがすごく楽
==DEMO== • (https://github.com/domitry/Nyaplotjs)
まとめ • Nyaplot – 汎用可視化ライブラリ – 3D, bio, mapなど •
JS使えれば自分で拡張が書ける • Nyaplotのbackend自体もportingが楽
3/3部 SciRubyへの誘い
SciRuby • 創始者: Johnさん • メンバ: 僕とか含めて20数人 • 活動場所: GitHub,
Hangouts, IRC
SciRubyの主な活動 • 科学技術系gemのメンテ • GSoCに来る学生のお守り
Google Summer of Code • Googleがお金を出して • OSS organizationが人(mentor)を出し •
学生が時間とコードを出す
Google Summer of Code • SciRubyが権利を持つコードのn%がGSoCの成 果物 • 実績があるため学生に割と人気、この時期になる とメールが……
過去にこんなメールが来た
None
SciRubyがメンテするソフトウェア • 基盤系から応用まで色々 • 皆gemになってる
1. NMatrix • SciRubyが始まったきっかけ • NArrayを使いやすくしよう!というモチベーショ ンだったはず
NMatrix pros • 配列はC-order • 標準で配列的な操作になる(行列的でない) • APIはNumpy風かも
==DEMO== • (.ipynbのURL)
NMatrix cons • 割とすぐゲロっちゃう • `gem install nmatrix`では入らない • NMatrix
install battleの発生
2. Daru • 2014年に出来たデータフレームgem • csvとかお手頃サイズのファイルを扱う際便利 • Ruby版Pandas
データフレーム? • 元々Rのdata.frameから来てるらしい • 統計解析に便利なメソッドを揃える • DaruはNyaplot::DataFrameと Pandas(Python)を元に作られている
==DEMO== • (.ipynbのURL)
3. Statsample • @clbustos さんが創始 • 統計解析用のライブラリ, pure-Ruby • `gem
install statsample`でOK
Statsample • ややメンテが滞り気味? • GSoCでは毎年何かネタを出してるので若返りに 期待 • Daruと互換性があるので今後活発になるかも
4.SymRuby • 記号計算用ライブラリ • SymPyやMathematicaみたいなやつ。 • SymPy(pure-python実装)からC++のバックエ ンドを切りだそう、ならRubyでラップも楽だよね という発想
==DEMO==
SymRuby • 使い心地は@gogotanakaさんのdxdyの方がよ かったかも… • ただsymengine自体に将来性があるので将来別 の人がcommitしてくれることを期待
その他もろもろ • FFTするやつ • Optimization tools • ODE solver
*宣伝* • 今年も(多分)Google Summer of Codeやりま す
Calls for students • Ph.DでもMasterでも学生と名のつく身分なら 何でもOK • 数カ月間の労働で5000$
Calls for students • テーマは色々、こっちから提案してもOK
Calls for mentors • 今年は9 slotsとのこと。人たりなさそう。 • お金は… 出ません •
学生と一緒に作った成果物で論文書いてる人はい る
まとめ? • IRuby/Jupyter – 講義などで共有するとき便利! • Nyaplot – 手元で可視化したいときに便利! •
SciRuby – 色々便利!
リンクの紹介(SciRuby) • SciRuby blog: – http://sciruby.com/blog • SciRuby ML: –
https://groups.google.com/forum/m/#!forum /sciruby-dev • SciRuby GitHub: – http://github.com/SciRuby
リンクの紹介(SciRuby) • Sammer(Daruの開発者)のブログ – http://v0dro.github.io/ • 僕のブログ等: – http://domitry.com
リンクの紹介(Nyaplot) • GitHub – http://github.com/domitry/nyaplot • Blog post – http://sciruby.com/blog/2014/08/23/nyaplo
t-interactive-plots-generateor-with-ruby/ – http://domitry.hatenablog.jp/entry/2014/ 08/23/215630
リンクの紹介(Jupyter) • Jupyter project – http://jupyter.org • Jupyter project ML
– https://groups.google.com/forum/#!forum/j upyter • E-Cell4 – https://github.com/ecell
リンクの紹介(Jupyter) • IJulia – https://github.com/JuliaLang/IJulia.jl • IHaskell – https://github.com/gibiansky/IHaskell •
IBrainf*ck – https://github.com/robbielynch/ibrainfuck
copyright • 木星の画像:CC-BY2.0 by NASA – https://www.flickr.com/photos/gsfc/13247890444 • ねこの画像:CC-BY2.0 by
Moyan Brenn – https://www.flickr.com/photos/aigle_dore/6672150457 • Rubyの画像:CC-BY2.0 by Nicolas Raymond – https://www.flickr.com/photos/82955120@N05/1960367180 2
copyright • その他、@domitryが権利を持つ文章など – CC-BY2.0