a b/doc/saving-and-loading-models.rst
1
Saving and loading models
2
=========================
3
4
Maui models may be saved to disk, so that they may be loaded again at a later time.
5
6
Saving a trained model to disk
7
------------------------------
8
9
Saving a model to disk involves saving two files to a target directory. These files store the model weights and the maui parameters (the arguments the maui model was instantiated with). :doc:`maui` implements a the save function
10
11
.. autofunction:: maui.Maui.save
12
13
The function takes one required parameter, the destination directory where the two files will be saved. It is called directly on a maui model, like 
14
15
.. code-block:: python
16
17
    maui_model.save('/path/to/dir')
18
19
20
Loading a model from disk
21
-------------------------
22
23
Loading a model involves instantiating a new Maui instance using the parameters that were used on the model that is saved to disk, and then populating the weights of the model to the previously trained weights. Once a model is loaded, it can be used to transform new data to the latent space, or it can be trained further. :doc:`maui` has a static function to load a model from disk
24
25
.. autofunction:: maui.Maui.load
26
27
It is called directly on the Maui class, like
28
29
.. code-block:: python
30
31
    maui.Maui.load('/path/to/dir')
32