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
200
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
670
精神は物理的に記述できるか
domitry
0
140
RubyとFortranの話
domitry
0
350
Nyaplot - a data visualization tool for Ruby
domitry
3
710
Nyaplotの紹介@U-22プロコン
domitry
1
170
D3.js入門
domitry
0
4.1k
3Dプリンタの使用感に関する考察
domitry
1
300
Other Decks in Technology
See All in Technology
上長や社内ステークホルダーに対する解像度を上げて、より良い補完関係を築く方法 / How-to-increase-resolution-and-build-better-complementary-relationships-with-your-bosses-and-internal-stakeholders
madoxten
13
7.3k
(新URLに移行しました)FASTと向き合うことで見えた、大規模アジャイルの難しさと楽しさ
wooootack
0
640
dbt Cloudの新機能を紹介!データエンジニアリングの民主化:GUIで操作、SQLで管理する新時代のdbt Cloud
sagara
0
190
データ戦略部門 紹介資料
sansan33
PRO
1
3.2k
What's new in OpenShift 4.19
redhatlivestreaming
1
180
産業機械をElixirで制御する
kikuyuta
0
140
名刺メーカーDevグループ 紹介資料
sansan33
PRO
0
770
堅牢な認証基盤の実現 TypeScriptで代数的データ型を活用する
kakehashi
PRO
1
200
Introduction to Sansan, inc / Sansan Global Development Center, Inc.
sansan33
PRO
0
2.6k
QAはソフトウェアエンジニアリングを学んで実践するのが大事なの
ymty
1
330
バクラクのモノレポにおける AI Coding のための環境整備と {Roo,Claude} Code活用事例 / AI Coding in Bakuraku's Monorepo: Environment Setup & Case Studies with {Roo, Claude} Code
upamune
9
5.7k
ハッカー視点で学ぶサイバー攻撃と防御の基本
nomizone
3
1.8k
Featured
See All Featured
Testing 201, or: Great Expectations
jmmastey
42
7.5k
Why You Should Never Use an ORM
jnunemaker
PRO
56
9.4k
Writing Fast Ruby
sferik
628
61k
Build The Right Thing And Hit Your Dates
maggiecrowley
36
2.7k
The Invisible Side of Design
smashingmag
299
50k
Optimising Largest Contentful Paint
csswizardry
37
3.3k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
48
5.4k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
137
34k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
228
22k
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
4
130
Mobile First: as difficult as doing things right
swwweet
223
9.6k
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