NeuraLegion / shainet

SHAInet - a pure Crystal machine learning library
MIT License
181 stars 19 forks source link

Support HDF5 and JSON to save and load models? #35

Closed drujensen closed 6 years ago

drujensen commented 6 years ago

Is there any plans to be able to load existing models and weights using HDF5 and JSON?

https://machinelearningmastery.com/save-load-keras-deep-learning-models/

I think it would be great to load existing keras models into shainet. I didn't see it on the roadmap and i'm not sure how complicated it would be to support. Just wondering if there are any plans and if you think this is possible.

bararchy commented 6 years ago

Looking at the formats of the files, it doesn't seems like such a far fetched thing to do, we will be adding a network.save\load option, so conforming to an existing established format is not such a big deal.

I'll take a stab at it in the weekend, if you want you can also play around with it :)

drujensen commented 6 years ago

@bararchy That would be awesome!

The model data in HDF5 should be straight forward as long as the models match.

The JSON for the model structure seems like it would be trickier since it is Keras specific including class_names: Sequential, Dense, RandomUniform, Zeros, etc.

drujensen commented 6 years ago

I played with shainet today using the pima diabetes dataset. Lot's of fun! Looking forward to being able to save and load a trained model.

https://github.com/drujensen/diabetes/blob/master/playground/diabetes.md#load-and-run-the-model

bararchy commented 6 years ago

Issue closed via PR #44 Thanks :)