-
Book Overview & Buying
-
Table Of Contents
Hands-On Machine Learning with C++ - Second Edition
By :
In this chapter, we learned how to save and load model parameters in different ML frameworks. We saw that all the frameworks we used in the Flashlight, mlpack, Dlib, and pytorch libraries have an API for model parameter serialization. Usually, these are quite simple functions that work with model objects and some input and output streams. We also discussed the serialization API, which can be used to save and load the overall model architecture. At the time of writing, some of the frameworks we used don’t fully support such functionality. For example, the Dlib library can export neural networks in XML format but can’t load them. The PyTorch C++ API lacks exporting functionality, but it can load and evaluate model architectures that have been exported from the Python API with its TorchScript functionality. However, the pytorch library does provide access to the library API, which allows us to load and evaluate models saved in the ONNX format from C++. However, note...