ï¼å·¦ï¼Kerasãå³ï¼MXnetï¼
Kaggle Masterã®éã§ã¯MXnetããããã«äººæ°ãªDeep Learningãã¬ã¼ã ã¯ã¼ã¯ã¨ãããã©ããã¼ãã@fcholletæ°ã®æã«ããKerasã
çµæ§è¦å¿ããã®ã§ãããããããæå ã®Pythonç°å¢ã§èµ°ãããã«ãªã£ãã®ã§ã試ãã¦ã¿ã¾ããããªãKerasã®æ¦è¦ã¨å ¨ä½åã«ã¤ãã¦ã¯id:aidiaryããã詳細ãªè§£èª¬ãæ¸ãã¦ä¸ãã£ã¦ããã®ã§ããã¡ãã®æ¹ãæ¯éãèªã¿ä¸ããã
追è¨
Kerasã¯äººæ°ã®ãã¬ã¼ã ã¯ã¼ã¯ãªã®ã§ãåãªããããããªããã°è¨äºãæ¸ãåããç´ æ´ãããç´¹ä»è¨äºã»ã¹ã¯ãªãããå¹¾ã¤ãããã¾ãããã¡ãã§ã¯åèã¾ã§ã«ä»¥ä¸ã®ãäºæ¹ã®ãã®ããç´¹ä»ããã¦ããã ãã¾ãã
Kerasã¯ã¬ã´ãããã¯ãçµã¿åããããã®ããã«ãã¦ãç°¡åã«ãã£ã¼ãã©ã¼ãã³ã°ã®ã¢ãã«ãä½æã§ãã便å©ãªã©ã¤ãã©ãªã§ããããã使ã£ã¦æ¥½ããéçºã§ããã®ã§ã¯ãªããã¨æãã¾ãã
ã¾ãã¨ã«ããæãã¾ãã
ä¸å¿ãã¡ãã§ãç°¡åã«è§£èª¬ãã¦ããã¨ãKerasã¯ããã¯ã¨ã³ãã«TensorFlowãããã¯Theanoã®å¥½ããªæ¹ãé¸ã¹ã°è¯ããã¨ããDeep Learningãã¬ã¼ã ã¯ã¼ã¯ã®ã©ããã¼ã§ããéçºè
ã®@fcholletæ°ã¨ã¡ãã£ã¨å人çã«ããåããããã¨ããããã§ãããå½¼ãèªã£ã¦ããã®ã¯ãTheanoã¯ãã¯ãç
©ééããããTensorFlowã¯ä½¿ãããããè¨ç®ã°ã©ãã®ç解ã®ã¨ãããé£ããã¦ä¸äººåãã§ã¯ãªããã¨ããã³ã¡ã³ãããåºæ¥ãã ãå¤ãã®äººã«Deep Learningã«è§¦ãã¦ããããããã¨ããã®ããã®éçºç念ã ããã§ãã
ã¡ãªã¿ã«ãå½¼ãTwitterã§åãã¦ããã®ããã©ãã¨ã覧ã«ãªã£ãæ¹ãããããããã¾ããããKerasããã¥ã¡ã³ãã®æ¥æ¬èªåããã¸ã§ã¯ããç®ä¸é²è¡ä¸ã®ããã§ã*1ãMXnetãè±èªä»¥å¤ã§ã¯ä¸å½èªããã¥ã¡ã³ãã®ã¿ãæ´åããã¦ãã¦ä¸å½èªåã§äººæ°ãé«ããã¨ãéã¿ãã«ããããKerasãæ¥æ¬äººã«æã馴æã¿æ·±ãDeep Learningãã¬ã¼ã ã¯ã¼ã¯ã®ä¸ã¤ã«ãªãããããã¾ãããã
ã¤ã³ã¹ãã¼ã«
å
ã«TensorFlowãå
¥ãã¦ããå¿
è¦ãããã¾ãã
詳ããã¯TensorFlowのドキュメントãè¦ã¦ãããããã®ã§ãããç°å¢ã«ãã£ã¦å ¥ãæ¹ãçµæ§ç°ãªãç¹ã«è¦æ³¨æãã¾ãæ¢åã®NumPyãåå ã§ã³ã±ãã±ã¼ã¹ãããã®ã§ããã®å ´åã®å¯¾å¦æ³ããã§ãã¯ãã¦ããã¾ããããä¸å¿ãããã¥ã¡ã³ãã«å¾ãã¨Python 2ç³»ã®å ´åã¯
# Ubuntu/Linux 64-bit $ sudo apt-get install python-pip python-dev # Mac OS X $ sudo easy_install pip $ sudo easy_install --upgrade six
ã®å¾ã«
# Ubuntu/Linux 64-bit, CPU only, Python 2.7 $ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.9.0rc0-cp27-none-linux_x86_64.whl # Ubuntu/Linux 64-bit, GPU enabled, Python 2.7 # Requires CUDA toolkit 7.5 and CuDNN v4. For other versions, see "Install from sources" below. $ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow-0.9.0rc0-cp27-none-linux_x86_64.whl # Mac OS X, CPU only, Python 2.7: $ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/mac/tensorflow-0.9.0rc0-py2-none-any.whl
ã¨ãã¦
# Python 2 $ sudo pip install --upgrade $TF_BINARY_URL
ã§å ¥ããã¨ãããã¨ã«ãªã£ã¦ãã¾ããä»ã«ãããã¥ã¡ã³ãã«ã¯VirtualEnv, Anaconda, Dockerã§å ¥ããæ¹æ³ãæ¸ãã¦ããã¾ããããã§ã¯å²æãã¾ãã
ã¾ããå¥ã®åé¡ã¨ãã¦äºåã«condaã§NumPyãå ¥ãã¦ããå ´åã¯ãããã³ã±ã¦ãã¾ãã¨ããã±ã¼ã¹ãæè¿ããããã§ã*2ããã®å ´åã¯ä»æ¹ãªãã®ã§ãNumPyã ãå¥ã«å ¥ãç´ãå¿ è¦ãããããã§ãã
ä»ã«ãNumPyå¨ãã§ã³ã±ãã±ã¼ã¹ã¯çµæ§ããããã§ãåãå®éã«è¦ãç¯å²ã ã¨こういうエラーãããã¿ããã§ã*3ããªã³ã¯å ã®éãã«ããã°è§£æ±ºãããããã¨æãã¾ãããåã®ç°å¢ã«ã¯ããã¤ãå¶ç´ããã£ã¦ã¾ã 試ãã¦ã¾ããorz
ãã®å¾ã§Kerasãå ¥ãã¾ããã¤ã³ã¹ãã¼ã«æ¹æ³ã¯æ®éã«Kerasã®ããã¥ã¡ã³ãã«æ¸ãã¦ããéãã§ãã½ã¼ã¹ãgit cloneãã¦ãã¦ãã
$ sudo python setup.py install
ã§ãè¯ãã§ãããæ®éã«pipã§
sudo pip install keras
ã§ãå ¥ãã¾ããå ¥ã£ããä»åº¦ã¯TensorFlowããã¯ã¨ã³ãã§åãããã¨ãæ³å®ãã¦ããã®ã§ãKerasのドキュメントã«å¾ã£ã¦è¨å®ãã¡ã¤ã«
~/.keras/keras.json
ã以ä¸ã®ããã«æ¸ãæãã¾ãï¼ä¸åº¦èµ·åããã¨çæãããJSONãã¡ã¤ã«ã ãé¢åãªãæåããã¨ãã£ã¿ã§æ¸ãã¦ãã¾ã£ã¦ãè¯ãï¼ã
# before {"epsilon": 1e-07, "floatx": "float32", "backend": "theano"} # after {"epsilon": 1e-07, "floatx": "float32", "backend": "tensorflow"}
ããã§ä¸å¿Kerasãåãããã«ãªãã¯ãã§ãã
Kerasã®CNNã§MNISTç縮çã®åé¡ããã£ã¦ã¿ã
åºæ¬çã«ã¯Kerasã®ããã¥ã¡ã³ãã«åºã¦ãããµã³ãã«ã³ã¼ããã»ã¼ãã®ã¾ã¾å½ã¦ã¯ããã ãã§ããããå
ã®ã³ã¼ãã ã¨è¥å¹²ããã©ã¼ãã³ã¹ãä¸ããã®ã§ãåã®æ¹ã§é©å½ã«ãã¥ã¼ãã³ã°ãç´ãã¦ãã¾ããMNISTç縮çã®CSVãã¡ã¤ã«2ã¤ã¯ä»¥ä¸ã®åã®GitHubããåã£ã¦ãã¦ãã ããã
ä¸å¿ãTensorFlowããã¯ã¨ã³ããã©ããã確èªãã¦ããã¾ãããã
import keras
Using TensorFlow backend. Using TensorFlow backend.
ãã®å¾ã¯ä»¥ä¸ã®ããã«çµãã°ãåºæ¬çã«ã¯èµ°ãã¯ãã§ãã
from __future__ import print_function from keras.layers.convolutional import Convolution2D from keras.layers.convolutional import MaxPooling2D from keras.layers.core import Activation from keras.layers.core import Dense from keras.layers.core import Dropout from keras.layers.core import Flatten from keras.models import Sequential from keras.utils import np_utils import numpy from pandas import DataFrame from pandas import read_csv data_train = read_csv("short_prac_train.csv") data_test = read_csv("short_prac_test.csv") batch_size = 100 nb_classes = 10 nb_epoch = 10 # input image dimensions img_rows, img_cols = 28, 28 # number of convolutional filters to use nb_filters = 20 # size of pooling area for max pooling nb_pool = 2 # convolution kernel size nb_conv = 5 # the data, shuffled and split between tran and test sets x_train = numpy.asarray([data_train.ix[i][1:] for i in range(len(data_train))]) x_test = numpy.asarray([data_test.ix[i][1:] for i in range(len(data_test))]) y_train = data_train['label'] y_test = data_test['label'] x_train = x_train.reshape(x_train.shape[0], img_rows, img_cols, 1) x_test = x_test.reshape(x_test.shape[0], img_rows, img_cols, 1) x_train = x_train.astype("float32") x_test = x_test.astype("float32") x_train /= 255 x_test /= 255 print("x_train shape:", x_train.shape) print(x_train.shape[0], "train samples") print(x_test.shape[0], "test samples") # convert class vectors to binary class matrices y_train = np_utils.to_categorical(y_train, nb_classes) y_test = np_utils.to_categorical(y_test, nb_classes) model = Sequential() model.add(Convolution2D(nb_filters, nb_conv, nb_conv, border_mode="valid", input_shape=(img_rows, img_cols, 1))) model.add(Activation("relu")) model.add(Convolution2D(nb_filters, nb_conv, nb_conv)) model.add(Activation("relu")) model.add(MaxPooling2D(pool_size=(nb_pool, nb_pool))) model.add(Dropout(0.5)) model.add(Flatten()) model.add(Dense(128)) model.add(Activation("relu")) model.add(Dropout(0.5)) model.add(Dense(nb_classes)) model.add(Activation("softmax")) model.compile(loss="categorical_crossentropy", optimizer="adadelta", metrics=["accuracy"]) model.fit(x_train, y_train, batch_size=batch_size, nb_epoch=nb_epoch, verbose=1, validation_data=(x_test, y_test)) score = model.evaluate(x_test, y_test, show_accuracy=True, verbose=0) print("Test score:", score[0]) print("Test accuracy:", score[1])
x_train shape: (5000, 28, 28, 1) 5000 train samples 1000 test samples Train on 5000 samples, validate on 1000 samples Epoch 1/10 5000/5000 [==============================] - 5s - loss: 0.9321 - acc: 0.6978 - val_loss: 0.1817 - val_acc: 0.9340 # ... # Epoch 10/10 5000/5000 [==============================] - 13s - loss: 0.0895 - acc: 0.9710 - val_loss: 0.0468 - val_acc: 0.9890 Test score: 0.0467970174281 Test accuracy: 0.989
ã¨ãããã¨ã§ãMXnetãã»ã¼åããã©ã¡ã¼ã¿è¨å®ã§åºããTest accuracy 0.987ï¼å¾è¿°ï¼ã¨ã»ã¼åãçµæã«ãªãã¾ããã
MXnetã®CNNã§MNISTç縮çã®åé¡ããã£ã¦ã¿ã
以åã®éå»è¨äºã§æ¢ã«ãè¦ãããéãã§ãããä¸å¿åæ²ãã¦ããã¾ãã
# Data preparation > train<-read.csv('https://github.com/ozt-ca/tjo.hatenablog.samples/raw/master/r_samples/public_lib/jp/mnist_reproduced/short_prac_train.csv') > test<-read.csv('https://github.com/ozt-ca/tjo.hatenablog.samples/raw/master/r_samples/public_lib/jp/mnist_reproduced/short_prac_test.csv') > train<-data.matrix(train) > test<-data.matrix(test) > train.x<-train[,-1] > train.y<-train[,1] > train.x<-t(train.x/255) > test<-test[,-1] > test<-t(test/255) # Model > data <- mx.symbol.Variable("data") > devices<-mx.cpu() > # first conv > conv1 <- mx.symbol.Convolution(data=data, kernel=c(5,5), num_filter=20) > tanh1 <- mx.symbol.Activation(data=conv1, act_type="relu") > pool1 <- mx.symbol.Pooling(data=tanh1, pool_type="max", + kernel=c(2,2), stride=c(2,2)) > drop1 <- mx.symbol.Dropout(data=pool1,p=0.5) > # second conv > conv2 <- mx.symbol.Convolution(data=drop1, kernel=c(5,5), num_filter=50) > tanh2 <- mx.symbol.Activation(data=conv2, act_type="relu") > pool2 <- mx.symbol.Pooling(data=tanh2, pool_type="max", + kernel=c(2,2), stride=c(2,2)) > drop2 <- mx.symbol.Dropout(data=pool2,p=0.5) > # first fullc > flatten <- mx.symbol.Flatten(data=drop2) > fc1 <- mx.symbol.FullyConnected(data=flatten, num_hidden=500) > tanh4 <- mx.symbol.Activation(data=fc1, act_type="relu") > drop4 <- mx.symbol.Dropout(data=tanh4,p=0.5) > # second fullc > fc2 <- mx.symbol.FullyConnected(data=drop4, num_hidden=10) > # loss > lenet <- mx.symbol.SoftmaxOutput(data=fc2) > train.array <- train.x > dim(train.array) <- c(28, 28, 1, ncol(train.x)) > test.array <- test > dim(test.array) <- c(28, 28, 1, ncol(test)) > mx.set.seed(0) > tic <- proc.time() > model <- mx.model.FeedForward.create(lenet, X=train.array, y=train.y, + ctx=devices, num.round=60, array.batch.size=100, + learning.rate=0.05, momentum=0.9, wd=0.00001, + eval.metric=mx.metric.accuracy, + epoch.end.callback=mx.callback.log.train.metric(100)) Start training with 1 devices [1] Train-accuracy=0.0975510204081633 [2] Train-accuracy=0.0906 [3] Train-accuracy=0.09 # ... # [59] Train-accuracy=0.978 [60] Train-accuracy=0.9822 > print(proc.time() - tic) ã¦ã¼ã¶ ã·ã¹ãã çµé 784.666 3.767 677.921 > preds <- predict(model, test.array) > pred.label <- max.col(t(preds)) - 1 > table(test_org[,1],pred.label) pred.label 0 1 2 3 4 5 6 7 8 9 0 99 0 0 0 0 0 1 0 0 0 1 0 99 0 0 1 0 0 0 0 0 2 0 0 98 0 0 0 0 1 1 0 3 0 0 0 98 0 1 0 0 1 0 4 0 2 0 0 97 0 1 0 0 0 5 0 0 0 0 0 99 1 0 0 0 6 0 0 0 0 0 0 100 0 0 0 7 0 0 0 0 0 0 0 99 1 0 8 0 0 0 0 0 0 0 0 100 0 9 0 0 0 0 2 0 0 0 0 98 > sum(diag(table(test_org[,1],pred.label)))/1000 [1] 0.987
ä¸è¿°ã®ããã«ãMXnetã§ã¯test accuracy 0.987ã¨ãããã¨ã§Kerasã®æ¹ãMXnetãä¸åã£ã¦ãã¾ããããã®å·®ã¯å ã0.002ãäºå®ä¸ã»ã¼åçã®æ§è½ã¨è¦ã¦è¯ãã§ããããããã¦Keras / MXnetã¨ãã¾ã ãã¥ã¼ãã³ã°ã®ä½å°ãå¤ããããã¨ãéã¿ãã«ã精度é¢ã§ã¯äºè§ã¨è¨ã£ã¦è¯ããã¨æãã¾ãã
ä¸æ¹ãã¹ãã¼ãã®æ¹ã¯MXnetã§ã¯ãã®accuracyãåºãã®ã«60 epochsãè²»ããã¦å
¨ä½ã§677ç§ãKerasã ã¨10 epochsã§200ç§åå¾ãMXnetã§ãã¹ããã¥ã¼ãã³ã°ãããã°ã¾ãç°ãªãããããã¾ããããä»åã®ä¾ã§ã¯Kerasã®æ¹ãåªãã¦ããã¨ããçµæã«ãªã£ã¦ãã¾ãã
MXnetã¨Kerasã®æ¯è¼ï¼ç¹ã«ã¢ãã«è¨è¿°é¨åï¼
ã¨ããã§ãå人çã«Keras / MXnetã¨ãã«å¤§ããªã¢ããã³ãã¼ã¸ã ãªã¨æã£ã¦ããã®ã¯ããã®ãç´æçãªã¤ã³ã¿ãã§ã¼ã¹ãã§ããåºæ¬çã«ã¯ãéæ¬ã深層å¦ç¿ããèªãã°èº«ã«ã¤ãç¥èããã®ã¾ã¾ä»¥ä¸ã®ãããªCNNè¨è¨é¨åã«è¨è¿°ããã°ãèµ°ã£ã¦ããã¾ãã
MXnetã®å ´å
> data <- mx.symbol.Variable("data") > # first conv > conv1 <- mx.symbol.Convolution(data=data, kernel=c(5,5), num_filter=20) > tanh1 <- mx.symbol.Activation(data=conv1, act_type="relu") > pool1 <- mx.symbol.Pooling(data=tanh1, pool_type="max", + kernel=c(2,2), stride=c(2,2)) > drop1 <- mx.symbol.Dropout(data=pool1,p=0.5) > # second conv > conv2 <- mx.symbol.Convolution(data=drop1, kernel=c(5,5), num_filter=50) > tanh2 <- mx.symbol.Activation(data=conv2, act_type="relu") > pool2 <- mx.symbol.Pooling(data=tanh2, pool_type="max", + kernel=c(2,2), stride=c(2,2)) > drop2 <- mx.symbol.Dropout(data=pool2,p=0.5) > # first fullc > flatten <- mx.symbol.Flatten(data=drop2) > fc1 <- mx.symbol.FullyConnected(data=flatten, num_hidden=500) > tanh4 <- mx.symbol.Activation(data=fc1, act_type="relu") > drop4 <- mx.symbol.Dropout(data=tanh4,p=0.5) > # second fullc > fc2 <- mx.symbol.FullyConnected(data=drop4, num_hidden=10) > # loss > lenet <- mx.symbol.SoftmaxOutput(data=fc2) > train.array <- train.x > dim(train.array) <- c(28, 28, 1, ncol(train.x)) > test.array <- test > dim(test.array) <- c(28, 28, 1, ncol(test)) > mx.set.seed(0) > tic <- proc.time() > model <- mx.model.FeedForward.create(lenet, X=train.array, y=train.y, + ctx=devices, num.round=60, array.batch.size=100, + learning.rate=0.05, momentum=0.9, wd=0.00001, + eval.metric=mx.metric.accuracy, + epoch.end.callback=mx.callback.log.train.metric(100))
Kerasã®å ´å
batch_size = 100 nb_classes = 10 nb_epoch = 20 # input image dimensions img_rows, img_cols = 28, 28 # number of convolutional filters to use nb_filters = 20 # size of pooling area for max pooling nb_pool = 2 # convolution kernel size nb_conv = 5 model = Sequential() model.add(Convolution2D(nb_filters, nb_conv, nb_conv, border_mode="valid", input_shape=(img_rows, img_cols, 1))) model.add(Activation("relu")) model.add(Convolution2D(nb_filters, nb_conv, nb_conv)) model.add(Activation("relu")) model.add(MaxPooling2D(pool_size=(nb_pool, nb_pool))) model.add(Dropout(0.5)) model.add(Flatten()) model.add(Dense(128)) model.add(Activation("relu")) model.add(Dropout(0.5)) model.add(Dense(nb_classes)) model.add(Activation("softmax")) model.compile(loss="categorical_crossentropy", optimizer="adadelta", metrics=["accuracy"]) model.fit(x_train, y_train, batch_size=batch_size, nb_epoch=nb_epoch, verbose=1, validation_data=(x_test, y_test))
æ§æã¨ãã¦ã¯KerasãMXnetãããä¼¼ã¦ãã¾ããã¢ãã«è¨è¿°é¨åã¯å層ã®ä¸èº«ï¼ä¾ãã°ã¦ãããæ°ã»ã«ã¼ãã«ãµã¤ãºã»ãã¼ãªã³ã°ãµã¤ãºã»æ´»æ§åé¢æ°ã»Dropoutçãªã©ï¼ããã ãã¿ãã¨æ¸ãã¦ãã ã²ãããã¡ã½ãããé çªã«æ¸ã足ãã¦ããã°è¯ãã ãã§ãå¾ã§å
¨ä½ã®ã¢ãã«ãè¨ç®ããã¡ã½ãããèµ°ãããã ãã§ããOOPã§æ¸ããã¦ããåãKerasã®æ¹ãã¹ãããªããã¹ã¯ãªããã«ãªã£ã¦ããå°è±¡ãããã¾ãããä¸æ¹ã§MXnetã®æ¹ãããå°ãç´°ãã調æ´ã§ããæããããã¾ãã¦ãããã¯ãäºãã«ä¸é·ä¸çã¨è¨ã£ãã¨ããã§ããããã
ä»ã«ããä¾ãã°ãã¥ã¼ãã³ã°ã«æãããã¦ã¼ã¶ã¼ãªãæ°ã«ãªãæé©åææ³ã®é¸æã®ã¨ããããKerasã§ããã°compileã¡ã½ããã®optimizerå¼æ°ã§ãMXnetã§ããã°mx.model.FeedForward.createã¡ã½ããã®optimizerå¼æ°ã§ãã好ã¿ã®ãã®ãé¸ã¶ãã¨ãã§ãã¾ããTheanoã§æ¸ãã¨é¢åèããã¨ãã®ä¸ãªãããã*4ã®ã§ãããããç¹ã§ãããããç¹ã§çµã¿ä¸ããã®ãé常ã«æ¥½ã ãªã¨æãã¦ãã¾ãã
Deep Learningã®ã¿ãªããæ©æ¢°å¦ç¿ã®democratizationï¼æ°ä¸»åï¼ã¸
æè¿ãæ¥çã§æã
è³ã«ãããã¼ã¯ã¼ãããæ©æ¢°å¦ç¿ã®democratizationï¼æ°ä¸»åï¼ããè¨ãæããã¨ãä¸æ¡ãã®ã¨ãã¹ãã¼ãã ãã§ãªããå¤ãã®æ°è¦åå
¥è
ãæ°è»½ã«Deep Learningã®ãããªå
é²çãªæ©æ¢°å¦ç¿ææ³ãå®è·µã§ããããã«ãªããã¨ãããã¨ã§ãã
å®éåé¡ãã¡ãã£ã¨åã¾ã§ã®æ©æ¢°å¦ç¿æ¥ç*5ã¯ã©ã¡ããã¨ããã¨ã´ãªã´ãªä½ãããã¹ã¯ã©ããããçµããã³ã¼ãã£ã³ã°åã¨æ©æ¢°å¦ç¿ã®å¦èã®åæ¹ã«é·ãã人æã§ãªãã¨æãåºããªãä¸çã§ãããããã®å¾ä¾ãã°scikit-learnã®ãããªããã±ã¼ã¸ã»ã©ã¤ãã©ãªãåºãæ®åããããã«ãªã£ãå¾ããDeep Learningãåãã¨ããå é²çãªã¢ãã«ã»ã¢ã«ã´ãªãºã ã®å®è·µã«ã¯ä¾ç¶ã¨ãã¦é«ãå£ãç«ã¡ã¯ã ãã£ã¦ããã¨ããå°è±¡ãããã¾ããã
ç¹ã«Deep Learningã¯ãã°ããã®éGPUã§åããã®ãã»ã¼åæã¨ããã¦ããææããããã¾ãTheanoã§çµãã¨ãªãã¨ã¹ã¯ã©ããããçµãããã¯é¥ãã«ãã·ãªãã®ã®ããã§ãçµæ§ç ©éã ã¨ããã®ããã£ã¦ãæ£ç´æãåºãã¥ãããªãã¨å人çã«ã¯æãã¦ãã¾ããã以ä¸ã®ãªã³ã¯å ã«ããã®ã¯id:aidiaryããã®æã«ããTheanoãç¨ããCNNå®è£ ã§ãããä¸è¨ã®Keras / MXnetã«ããå®è£ ã¨æ¯ã¹ãã¨ãã¯ãããªãã®å´ä½ã«ãªãã¨ããã®ããåããã«ãªããã¨æãã¾ãã
ãããã«æ¯ã¹ãã¨ãKeras / MXnetã®ã·ã³ãã«ãã¨ã¹ã¯ãªããã®åããããããããã¦ã¹ã¯ãªãããåãããããã«ãããããããã¥ã¼ãã³ã°ã容æã«ã§ããã¨ãã便å©ããç¹ã«éç«ã£ã¦è¦ã¦åããã¨æãã¾ãã
ããã¦Kerasã®å ´åã¯ããã¯ã¨ã³ãã«TensorFlowãå©ç¨ã§ããã¨ãããã¨ã§ããã®ãã¼ã ããªã¥ã¼ã¨ã·ã¹ãã ã»ããã¢ããã®ç°¡ä¾¿ãããä»å¾åºãæ®åãããã¨ã確å®è¦ãããTensorFlowãã¤ã³ã¹ãã¼ã«ããã¦ããç°å¢ã§ããã°æ°è»½ã«ä½¿ãããã¨ããã®ãKerasã®å©ç¹ã¨è¨ããã§ããããè¨ãæããã¨ãTensorFlowãæã¤CPU / GPUåãæ¿ãã®å®¹æããåæ£ç°å¢ã¸ã®æ¡å¼µã®å®¹æããªã©ãªã©ã«ãã®ã¾ã¾ä¹ã£ãããã¨ãã§ããã®ã§ããããªãçºå±ãæãã¾ãã
ããããããKeras / MXnetãããããã«ããã«å®¹æã«Deep Learningãçµããã·ã³ãã«ãªãã¬ã¼ã ã¯ã¼ã¯ãç»å ´ããããããã¾ããã*6ãä»å¾ãããã®ãã¬ã¼ã ã¯ã¼ã¯ã«ããDeep Learningããã¦æ©æ¢°å¦ç¿ãã®ãã®ã®democratizationãé²ãã§ãããã®ã¨æå¾ ãã¦ããã¾ãã
*1:@fcholletæ°ã¯ããããæ¥æ¬ã§ã®çå¦çµé¨ãããã¨ãããã¨ã§ãæ¥æ¬ã§ãæ¯éKerasãåºãããã¨ããã話ã®ããã§ã
*2:èªè ¹EC2ã¤ã³ã¹ã¿ã³ã¹ã«å ¥ããæã¯ããã§ããã£ãorz
*3:MBPã«å ¥ããæã¯ããã§ããã£ãorz
*4:èªåã§ã¯çµãã ãã¨ãªããã®ã§ä¼èã§ãç¬
*5:å¦è¡ç³»ã§ã¯ãªãå®åç³»ã§ãã
*6:ããå¿ ããä½ããããããããã®ãç»å ´ããã ããã¨äºæ³ãã¦ãã¾ãã