Getting Started with Deep Learning using Scala

Post on 26-Jan-2017

1208 Views

Category:

Software

2 Downloads

Preview:

Click to see full reader

Transcript

Getting Started with DeepLearning using Scala

@OE_uia

Who I am:

Taisuke Oe (TW: @OE_uia, GITHUB: taisukeoe)

● Android App Developer in Scala● ND4S creator● ND4J contributor

Agenda / Disclaimer

What I’m going to talk:

- What is Deep Learning?- What is Neural Network?- How Neural Netowork works over training.- DeepLearning4j architecture

What I’m NOT going to talk (in detail):

- Type of Neural Network- Hyper parameter and its tuning

今日は深層学習とニューラルネットワークの基礎、 DeepLearning4jのアーキテクチャについて触れます

What is Machine Learning?

"Field of study that gives computers the ability to learn without being explicitly programmed."

Arthur Samuel (1959)

機械学習とは、明示的にプログラムされなくてもコンピューターに学ぶ能力を付与する研究分野のこと。

What is Deep Learning?

- A category of Machine Learning,

especially for images, text, audio, etc.

- Accurate and reasonably fast.

- Train “Neural Networks” with updating its parameters

over iterations.- Neural Network has a layered structure, and learns

features in each layer

深層学習は、ニューラルネットワークを使う機械学習の一分野で、画像、文章、音などを対象とする。

DeepLearning4j Archtecture

Canova DeepLearning4j

ND4J

DeepLearning4jの主な3つのモジュール。 DeepLearning4j, ND4J, Canova。

DeepLearning4j Archtecture

Canova DeepLearning4j

ND4J

General Vectorization Library.

Vectorize raw data to INDArray.

DeepLearning Framework.

Construct Neural Network based on configuration.

N-dimensional Arraycalculation Library.

DeepLearning4jが設定からニューラルネットを構築。 Canovaは生データをベクター化。 ND4Jはそれらの計算基盤。

DeepLearning4j Archtecture

Canova DeepLearning4jImages

Text

Audio

ND4J

Canovaは、画像やテキスト、オーディオなどの生データを解釈する。

DeepLearning4j Archtecture

Canova DeepLearning4jImages

Text

Audio

INDArray

ND4J

disclaimer: it’s a simplified example very much.

例えば、Canovaが生の画像を計算しやすいように N次元行列(この例では2次元)に変換する。

DeepLearning4j Archtecture

Canova DeepLearning4jImages

Text

Audio

INDArray

ND4J

INDArray

ND4S

disclaimer: it’s a simplified example very much.

場合によっては、ND4SでN次元行列を計算ないしは学習しやすいように変換する。

DeepLearning4j Archtecture

Canova DeepLearning4j

ND4J

N dimensional Sample Data

disclaimer: it’s a simplified example very much.

DeepLearning4jによって構築されたニューラルネットが N次元行列の入力を受け取り、結果を表す N次元行列を返す

DeepLearning4j Archtecture

Canova DeepLearning4j

ND4J

N dimensional Sample Data

disclaimer: it’s a simplified example very much.

この例では出力された行列の各列が各クラスに分類される確率を表す。 2が90%、3が10%という具合。

How DeepLearning works

N dimensional Sample Data

Parameters in Neural Network (in this picture, Multi Layer Perceptron) got updated over iterations

# of samples

トレーニングの際。サンプルをミニバッチごとに分けて入力させる。ニューラルネット内の状態が更新され続ける。

How DeepLearning works

N dimensional Sample Data

# of samples

Neural Network hasstates which are updated over iteration.

DataSet has states like a iterator.Spit out samples in each mini-batch.

トレーニングの際。サンプルをミニバッチごとに分けて入力させる。ニューラルネット内の状態が更新され続ける。

How DeepLearning works

N dimensional Sample Data

# of samples

Neural Network hasstates which are updated over iteration.

Go to the detail:How neuron unit behaves:

トレーニングを通じて更新される、ニューラルネット内の「状態」の中身を見ていきましょう。

How Neuron works

構成単位ニューロン。各 (x:入力)に(w:重み)を乗じて(b:バイアス)を足したものを、活性化関数 fに渡して出力計算。

How Neuron works

mutable!

mutable!

immutable!

(w 重み)と(b バイアス)は変数で、トレーニングごとに更新される。 活性化関数 fは不変。

How Neural Net work in each layer

(全結合な)ニューラルネットの各層は、重み行列、バイアス行列、活性化関数からなる関数で表現される

Further information:

- Type of Neural Network - Convolutional Neural Network

- Recurrent Neural Network

- etc

- Backpropagation- Loss Function- Learning rate - Other hyper parameters

深層学習 http://www.amazon.co.jp/dp/B018K6C99A/

Coursera https://www.coursera.org/course/neuralnets

(w:重み)と(b:バイアス)を更新する方法は、誤差逆伝搬法と損失関数、学習係数などで決定される。詳しくは書籍などで。

How to improve results?

- Choose appropriate Neural Network(s)- Tune hyper parameters of Neural Network(s).- Pre-process input data to be efficiently trained.

学習結果を改善させるには?ニューラルネットワークのタイプを選ぶ、超パラメータを調整、入力データのプリプロセシング。

Summary

- Deep Learning is a category of Machine Learning, which is trained by Neural Networks with three or more layers.

- Neural Network maps input feature matrix to output matrix which stands for possibilities of each class in classification purpose.

- DeepLearning4j: Deep Learning framework in JVM- Nd4j: N-dimensional array calculation library- Canova: General vectorization library- Nd4s: NumPy-like + Scala-like API for ND4J

深層学習は、3層以上からなるニューラルネットワークで行う機械学習のこと。N次元行列の生データを加工するなどして、パフォーマンスを上げる。

top related