deephealthproject / eddl

European Distributed Deep Learning (EDDL) library. A general-purpose library initially developed to cover deep learning needs in healthcare use cases within the DeepHealth project.
https://deephealthproject.github.io/eddl/
MIT License
34 stars 10 forks source link

Serialization / deserialization of optimizers and computing services #239

Closed jph11 closed 3 years ago

jph11 commented 3 years ago

Hi! Would it be possible to add specific functions for the serialization of the optimizers and computing services? At this moment, the serialization of the whole neural network is supported and working fine. However, we'd need something similar for the optimizers and CS in order to fully share them with the worker nodes that make up a distributed training.

The serialization and deserialization of the whole neural network takes place this way (Python syntax):

- eddl.import_net_from_onnx_string(self.model)
- eddl.serialize_net_to_onnx_string(model, False)

We'd like to have something similar for the optimizers. A suggested syntax:

- eddl.import_optimizer_from_onnx_string(optimizer_string)
- eddl.serialize_optimizer_to_onnx_string(eddl.sgd(0.01, 0.9))

And also for the computing services:

- eddl.import_cs_from_onnx_string(computing_service_string)
- eddl.serialize_cs_to_onnx_string(eddl.CS_CPU(mem="full_mem"))
jonandergomez commented 3 years ago

Dear jph11,

Please, could review the following C++ example still in the develop branch? https://github.com/deephealthproject/eddl/blob/develop/examples/onnx/4_utils_serialization.cpp

I guess this is what you are asking but for Python, isn't it?

Could you please confirm? Then we will manage to include such methods in the Python API (PyEDDL) in the next release in the master branch.

Regards,

Jon