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
210
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
290
PCで絵をかこう!
domitry
0
560
JavaScript&可視化講習会#1
domitry
1
680
精神は物理的に記述できるか
domitry
0
150
RubyとFortranの話
domitry
0
350
Nyaplot - a data visualization tool for Ruby
domitry
3
720
Nyaplotの紹介@U-22プロコン
domitry
1
170
D3.js入門
domitry
0
4.2k
3Dプリンタの使用感に関する考察
domitry
1
300
Other Decks in Technology
See All in Technology
AWS re:Inforce 2025 re:Cap Update Pickup & AWS Control Tower の運用における考慮ポイント
htan
1
200
リリース2ヶ月で収益化した話
kent_code3
1
170
20250728 MCP, A2A and Multi-Agents in the future
yoshidashingo
1
210
Perlアプリケーションで トレースを実装するまでの 工夫と苦労話
masayoshi
1
400
Unson OS|48時間で「売れるか」を判定する AI 市場検証プラットフォーム
unson
0
170
製造業の課題解決に向けた機械学習の活用と、製造業特化LLM開発への挑戦
knt44kw
0
150
【Λ(らむだ)】最近のアプデ情報 / RPALT20250729
lambda
0
230
Segment Anything Modelの最新動向:SAM2とその発展系
tenten0727
0
210
Rubyの国のPerlMonger
anatofuz
3
720
AIのグローバルトレンド 2025 / ai global trend 2025
kyonmm
PRO
1
120
生成AI導入の効果を最大化する データ活用戦略
ham0215
0
100
Claude CodeでKiroの仕様駆動開発を実現させるには...
gotalab555
3
860
Featured
See All Featured
Site-Speed That Sticks
csswizardry
10
750
Understanding Cognitive Biases in Performance Measurement
bluesmoon
29
1.8k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
33
2.4k
Why Our Code Smells
bkeepers
PRO
337
57k
StorybookのUI Testing Handbookを読んだ
zakiyama
30
6k
Writing Fast Ruby
sferik
628
62k
Scaling GitHub
holman
461
140k
Bootstrapping a Software Product
garrettdimon
PRO
307
110k
GitHub's CSS Performance
jonrohan
1031
460k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
8
870
YesSQL, Process and Tooling at Scale
rocio
173
14k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
182
54k
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