Skip to content

Commit 25b9c4c

Browse files
author
Ilia Karmanov
authored
Merge pull request ilkarman#75 from ilkarman/vapaunic/kerasr_lin
Keras (TF) R samples
2 parents a709c06 + 0c27e52 commit 25b9c4c

File tree

6 files changed

+1548
-12
lines changed

6 files changed

+1548
-12
lines changed

README.md

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ The notebooks are executed on an Azure [Deep Learning Virtual Machine](https://a
4040
| [PyTorch](notebooks/PyTorch_CNN.ipynb) | 169 | 51 |
4141
| [Julia - Knet](notebooks/Knet_CNN.ipynb) | 159 | ?? |
4242
| [R - MXNet](notebooks/.ipynb) | ??? | ?? |
43+
| [R - Keras (TF)](notebooks/KerasR_TF_CNN.ipynb) | 211 | 75 |
44+
4345

4446

4547
*Note: It is recommended to use higher level APIs where possible; see these notebooks for examples with [Tensorflow](support/Tensorflow_CNN_highAPI.ipynb), [MXNet](support/MXNet_CNN_highAPI.ipynb) and [CNTK](support/CNTK_CNN_highAPI.ipynb). They are not linked in the table to keep the common-structure-for-all approach*
@@ -67,18 +69,19 @@ Comparing synthetic data to actual PNG files we can estimate the IO lag for **Py
6769

6870
### 3. Avg Time(s) for 1000 images: ResNet-50 - Feature Extraction
6971

70-
| DL Library | K80/CUDA 8/CuDNN 6 | P100/CUDA 8/CuDNN 6 |
71-
| --------------------------------------------------- | :----------------: | :-----------------: |
72-
| [Caffe2](notebooks/Caffe2_Inference.ipynb) | 14.1 | 7.9 |
73-
| [Chainer](notebooks/Chainer_Inference.ipynb) | 9.3 | 2.7 |
74-
| [CNTK](notebooks/CNTK_Inference.ipynb) | 8.5 | 1.6 |
75-
| [Keras(CNTK)](notebooks/Keras_CNTK_Inference.ipynb) | 21.7 | 5.9 |
76-
| [Keras(TF)](notebooks/Keras_TF_Inference.ipynb) | 10.2 | 2.9 |
77-
| [Tensorflow](notebooks/Tensorflow_Inference.ipynb) | 6.5 | 1.8 |
78-
| [MXNet](notebooks/MXNet_Inference.ipynb) | 7.7 | 2.0 |
79-
| [PyTorch](notebooks/PyTorch_Inference.ipynb) | 7.7 | 1.9 |
80-
| [Julia - Knet](notebooks/Knet_Inference.ipynb) | 6.3 | ??? |
81-
| [R - MXNet](notebooks/.ipynb) | ??? | ??? |
72+
| DL Library | K80/CUDA 8/CuDNN 6 | P100/CUDA 8/CuDNN 6 |
73+
| ---------------------------------------------------- | :----------------: | :-----------------: |
74+
| [Caffe2](notebooks/Caffe2_Inference.ipynb) | 14.1 | 7.9 |
75+
| [Chainer](notebooks/Chainer_Inference.ipynb) | 9.3 | 2.7 |
76+
| [CNTK](notebooks/CNTK_Inference.ipynb) | 8.5 | 1.6 |
77+
| [Keras(CNTK)](notebooks/Keras_CNTK_Inference.ipynb) | 21.7 | 5.9 |
78+
| [Keras(TF)](notebooks/Keras_TF_Inference.ipynb) | 10.2 | 2.9 |
79+
| [Tensorflow](notebooks/Tensorflow_Inference.ipynb) | 6.5 | 1.8 |
80+
| [MXNet](notebooks/MXNet_Inference.ipynb) | 7.7 | 2.0 |
81+
| [PyTorch](notebooks/PyTorch_Inference.ipynb) | 7.7 | 1.9 |
82+
| [Julia - Knet](notebooks/Knet_Inference.ipynb) | 6.3 | ??? |
83+
| [R - MXNet](notebooks/.ipynb) | ??? | ??? |
84+
| [R - Keras (TF)](notebooks/KerasR_TF_Inference.ipynb)| 16 | 7.5 |
8285

8386

8487
A pre-trained ResNet50 model is loaded and chopped just after the avg_pooling at the end (7, 7), which outputs a 2048D dimensional vector. This can be plugged into a softmax layer or another classifier such as a boosted tree to perform transfer learning. Allowing for a warm start; this forward-only pass to the avg_pool layer is timed. *Note: batch-size remains constant, however filling the RAM on a GPU would produce further performance boosts (greater for GPUs with more RAM).*
@@ -95,6 +98,7 @@ A pre-trained ResNet50 model is loaded and chopped just after the avg_pooling at
9598
| [Tensorflow](notebooks/Tensorflow_RNN.ipynb) | 30 | 22 | Yes |
9699
| [Julia - Knet](notebooks/Knet_RNN.ipynb) | 29 | ?? | Yes |
97100
| [R - MXNet](notebooks/.ipynb) | ?? | ?? | ??? |
101+
| [R - Keras (TF)](notebooks/KerasR_TF_RNN.ipynb) | 238 | 209 | No |
98102

99103

100104
Input for this model is the standard [IMDB movie review dataset](http://ai.stanford.edu/~amaas/data/sentiment/) containing 25k training reviews and 25k test reviews, uniformly split across 2 classes (positive/negative). Processing follows [Keras](https://github.com/fchollet/keras/blob/master/keras/datasets/imdb.py) approach where start-character is set as 1, out-of-vocab (vocab size of 30k is used) represented as 2 and thus word-index starts from 3. Zero-padded / truncated to fixed axis of 150 words per review.

0 commit comments

Comments
 (0)