Investigate Keras Model Compression before SQL generation
This is probably a way to avoid some unnecessarily large models and generate an (almost) equivalent SQL code.
There are at least 4 methods for compressing keras models in

https://arxiv.org/pdf/1710.09282.pdf

Would be nice to test this :
Model Compression Based on Geoffery Hinton's Logit Regression Method in Keras applied to MNIST 16x compression over 0.95 percent accuracy
https://github.com/Irtza/Keras_model_compression
Factorization method :
low-rank approximation 1. with SVD (matrix) 2. with Tucker (tensor)
https://github.com/DwangoMediaVillage/keras_compressor