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
150
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
260
PCで絵をかこう!
domitry
0
530
JavaScript&可視化講習会#1
domitry
1
620
精神は物理的に記述できるか
domitry
0
120
RubyとFortranの話
domitry
0
310
Nyaplot - a data visualization tool for Ruby
domitry
3
620
Nyaplotの紹介@U-22プロコン
domitry
1
140
D3.js入門
domitry
0
3.9k
3Dプリンタの使用感に関する考察
domitry
1
270
Other Decks in Technology
See All in Technology
Databricksを活用してDELISH KITCHENのレシピレコメンドを開発した話
furu8
0
250
開発生産性向上サービスを作るFindyが自分たちで開発生産性を爆上げした組織づくりの歩み / Findy's path to boosting its own development productivity 2024-04-17
ma3tk
3
320
「手動オペレーションに定評がある」と言われた私が心がけていること / phpcon_odawara2024
blue_goheimochi
2
320
株式会社EventHub・エンジニア採用資料
eventhub
0
1.9k
SREとその組織類型
tatsuo48
8
1.5k
元インフラエンジニアに成る / Human Resources to Human Relations
bobtani
3
770
反実仮想機械学習とは何か
usaito
PRO
6
1.9k
日本におけるデータエンジニアリングのこれまでとこれから
foursue
10
2.1k
最近たまに見かけるTiDBってなんだ? - Findy
pingcap0315
2
570
シン・Kafka / shin-kafka
oracle4engineer
PRO
7
2.7k
普段有償でサポート業務をしているCSAが技術知見を無料で公開する理由
07jp27
1
630
Hands-on / Kaname Frusawa / Cloud Compare Users Meetup 2024 at University of Tokyo on April 17
paraworld
2
470
Featured
See All Featured
Principles of Awesome APIs and How to Build Them.
keavy
120
16k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
9
8.3k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
1
3.4k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
220
21k
GraphQLの誤解/rethinking-graphql
sonatard
50
9.2k
A designer walks into a library…
pauljervisheath
199
23k
StorybookのUI Testing Handbookを読んだ
zakiyama
11
4.6k
Typedesign – Prime Four
hannesfritz
36
2.1k
Making the Leap to Tech Lead
cromwellryan
123
8.5k
Scaling GitHub
holman
457
140k
Clear Off the Table
cherdarchuk
83
310k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
29
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