numpy-ml icon indicating copy to clipboard operation
numpy-ml copied to clipboard

Feature request: save/load model to/from json

Open DannyVarod opened this issue 1 year ago • 0 comments

To easily use these models in a robust non-version-dependent way, an option to save/load model to/from json (either string or file) would be helpful.

E.g.

# save to json (can be stored anywhere, not just in file)
model_json = model.save_to_json()

# save to json file
with open(...) as f:
    model.save_to_json_file(f)   # create folder and parent folders if not exist

# load from json
model = Model.load_from_json(json)

# load from json file
with open(...) as f:
    Model.load_from_json_file(f)

DannyVarod avatar Aug 09 '23 15:08 DannyVarod