keras2sql
keras2sql copied to clipboard
Add support for convolutions
Sample use case : simple convnet on the MNIST dataset
keras example : https://github.com/keras-team/keras/blob/master/examples/mnist_cnn.py
used layers and activation functions :
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='softmax'))
Added a primary implementation which works for small models.
Main pain points (to be solved):
- The second Conv2D layer
- the Flatten layer is too large (depends on the number of filters used in convolutions : 32 and 64). This layer works for small number of filters (in the jupyter notebook , we use 8 and 0)
- When the size of Flatter layer goes above 1000, we have some issues with the databases support for wide tables. => create separate issue (at least for some experiments. May not be solvable).
- The Dense layer leads to a very large model and SQL code. Need to perform some feature selection (make sparse models) and some simplification of the SQL code (non-used columns can be deleted).
Another possibility is to perform a compression (exact or approximate) of the model.
new issue => #5