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
570
JavaScript&可視化講習会#1
domitry
1
680
精神は物理的に記述できるか
domitry
0
150
RubyとFortranの話
domitry
0
360
Nyaplot - a data visualization tool for Ruby
domitry
3
720
Nyaplotの紹介@U-22プロコン
domitry
1
180
D3.js入門
domitry
0
4.2k
3Dプリンタの使用感に関する考察
domitry
1
310
Other Decks in Technology
See All in Technology
Rustから学ぶ 非同期処理の仕組み
skanehira
1
140
Platform開発が先行する Platform Engineeringの違和感
kintotechdev
4
570
【実演版】カンファレンス登壇者・スタッフにこそ知ってほしいマイクの使い方 / 大吉祥寺.pm 2025
arthur1
1
880
Oracle Base Database Service 技術詳細
oracle4engineer
PRO
9
73k
複数サービスを支えるマルチテナント型Batch MLプラットフォーム
lycorptech_jp
PRO
1
440
Generative AI Japan 第一回生成AI実践研究会「AI駆動開発の現在地──ブレイクスルーの鍵を握るのはデータ領域」
shisyu_gaku
0
290
KotlinConf 2025_イベントレポート
sony
1
140
2025年になってもまだMySQLが好き
yoku0825
8
4.8k
Aurora DSQLはサーバーレスアーキテクチャの常識を変えるのか
iwatatomoya
1
1k
Evolución del razonamiento matemático de GPT-4.1 a GPT-5 - Data Aventura Summit 2025 & VSCode DevDays
lauchacarro
0
210
【初心者向け】ローカルLLMの色々な動かし方まとめ
aratako
7
3.5k
S3アクセス制御の設計ポイント
tommy0124
3
200
Featured
See All Featured
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
188
55k
[RailsConf 2023] Rails as a piece of cake
palkan
57
5.8k
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.4k
VelocityConf: Rendering Performance Case Studies
addyosmani
332
24k
Learning to Love Humans: Emotional Interface Design
aarron
273
40k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
33
2.4k
We Have a Design System, Now What?
morganepeng
53
7.8k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
22k
Producing Creativity
orderedlist
PRO
347
40k
Six Lessons from altMBA
skipperchong
28
4k
A designer walks into a library…
pauljervisheath
207
24k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
48
9.7k
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