arfc / annsa

Artificial neural networks for spectral analysis.
BSD 3-Clause "New" or "Revised" License
12 stars 4 forks source link

Change model_classes to use the Keras Sequential API #79

Open kamuda1 opened 5 years ago

kamuda1 commented 5 years ago

There are multiple issues that can be solved by rewriting model_classes to build models using the Sequential API. Currently models are constructed using the functional API. The functional API allows for customization outside the scope of ANNSA (models that share layers, multiple network inputs, acyclic network graphs). The Sequential API also allows for built models to be easily passed to sklearn for hyperparameter tuning (keras.wrappers.scikitlearn.KerasClassifier).

Training with the Sequential API would fix:

This issue can be closed when each model in model_classes is written using the Sequential API and tests exist to ensure they run as expected.

kamuda1 commented 5 years ago

To ensure backwards compatibility and transparency, the functional API implementation will be kept in the model_classes.py module and the Sequential API method should be added to a new module.