Commit 71bbe08c authored by Gustavo Valiente's avatar Gustavo Valiente

Readme: performance section added

parent f7ff1199
......@@ -5,9 +5,10 @@ pocket-tensor is a [Kerasify](https://github.com/moof2k/kerasify) fork designed
## Design goals
* Compatibility with sequential networks generated by Keras 2.x using Tensorflow backend.
* CPU support only (no GPU).
* Multithread CPU support (no GPU support).
* Low RAM usage.
* Easy to build and run (no external dependencies).
* Unit tests for each supported layer.
* Fast build times.
## Improvements over Kerasify
......@@ -119,3 +120,47 @@ The most common layer types used in image recognition and sequences prediction a
* Sequences related: `LSTM`, `Embedding`.
* Activations: `Linear`, `ReLU`, `ELU`, `Softplus`, `Softsign`, `Tanh`, `Sigmoid`, `HardSigmoid`, `Softmax`.
* Other: `Dense`, `Flatten`, `MaxPooling2D`, `BatchNormalization`, `ELU`.
## Performance
The prediction time of the following models have been measured on a Raspberry Pi 3:
CNN:
```python
model = Sequential()
model.add(Conv2D(32, kernel_size=(3, 3),
activation='relu',
input_shape=input_shape))
model.add(Conv2D(64, (3, 3), activation='relu'))
model.add(MaxPooling2D(pool_size=(2, 2)))
model.add(Dropout(0.25))
model.add(Flatten())
model.add(Dense(128, activation='relu'))
model.add(Dropout(0.5))
model.add(Dense(num_classes, activation='sigmoid'))
```
| Library | Elapsed time (us) |
| ------------- | ----------------: |
| Keras | 23363 |
| Kerasify | 64238 |
| frugally-deep | 29298 |
| pocket-tensor | 27329 |
LSTM:
```python
model = Sequential()
model.add(Embedding(max_features, 128))
model.add(LSTM(128, return_sequences=True, dropout=0.2, recurrent_dropout=0.2))
model.add(LSTM(128, return_sequences=False, dropout=0.2, recurrent_dropout=0.2))
model.add(Dense(1, activation='sigmoid'))
```
| Library | Elapsed time (us) |
| ------------- | ----------------: |
| Keras | 89344 |
| Kerasify | 79060 |
| frugally-deep | Not supported |
| pocket-tensor | 67115 |
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment