xiangze's sparse blog

機械学習、ベイズ統計、コンピュータビジョンと関連する数学について

1行でディープラーニングできなかった(theanoとH2O)。

pip install theano

import urllib2
exec(urllib2.urlopen("https://gist.githubusercontent.com/xiangze/90c2a215b46dad907329/raw/onelineardA.py").read())

data(MNIST)のダウンロードではまったら頑張りましょう。

元ネタ(H2O)

theanoがGPGPUを用いた計算の高速化を標榜しているのに対して、
H2Oでは並列化、分散Key-Valueストア,GCの最適化など巨大なデータの扱いを高速で行えるようにしたところに特色があるようです。
本体はJavaで書かれていてh2o.init()で専用のVMが起動します。

h2o.importHDFS()とかできるらしいです。



>localH2O = h2o.init()

H2O is not running yet, starting it now...

Note: In case of errors look at the following log files:
C:/TMP/h2o_xiangze_started_from_r.out
C:/TMP/h2o_xiangze_started_from_r.err

java version "1.7.0_17"
Java(TM) SE Runtime Environment (build 1.7.0_17-b02)
Java HotSpot(TM) 64-Bit Server VM (build 23.7-b01, mixed mode)

Successfully connected to http://127.0.0.1:54321
R is connected to H2O cluster:
H2O cluster uptime: 1 seconds 302 milliseconds
H2O cluster version: 2.4.0.5
H2O cluster name: H2O_started_from_R
H2O cluster total nodes: 1
H2O cluster total memory: 0.00 GB
H2O cluster total cores: 0
H2O cluster healthy: FALSE

> irisPath = system.file("extdata", "iris.csv", package = "h2o")
>
> iris.hex = h2o.importFile(localH2O, path = irisPath)
|=============================================================================| 100%
>
> h2o.deeplearning(x = 1:4, y = 5, data = iris.hex, activation = "Tanh")
|=============================================================================| 100%
IP Address: localhost
Port : 54321
Parsed Data Key: iris.hex
Deep Learning Model Key: DeepLearning_9d175ac6ae635993a6099875abcb45d2

Training classification error: 0.03333333
Training mean square error: Inf

Validation classification error: 0.03333333
Validation square error: Inf

Confusion matrix:
Reported on iris.hex
Predicted
Actual Iris-setosa Iris-versicolor Iris-virginica Error
Iris-setosa 50 0 0 0.000
Iris-versicolor 0 46 4 0.080
Iris-virginica 0 1 49 0.020
Totals 50 47 53 0.033

その他概要(H2O)

R,python風の言語で使える。Excelgoogle風サーチバーからも使用できる?
使用可能アルゴリズム

  • GLM/GLMnet
  • Random Forest
  • GBM
  • Deep Learning
  • K-Means
  • PCA

Stochastic SVDも実装される予定?

Mahout,Jubatusにはないもの(deep learning)があるのが優位な点でしょうか…

Reference

H2O.ai's Distributed Deep Learning by Arno Candel 04/03/14アーキテクテャの図が特にわかりやすいです。