提交 839043bb authored 作者: Bart van Merrienboer's avatar Bart van Merrienboer 提交者: serdyuk

Slight doc rewrite

上级 acd4da11
......@@ -117,20 +117,25 @@ For instance, you can define functions along the lines of:
Robust Serialization
====================
This type of serialization internally uses pickling but extracts values of all
arrays (`CudaNdarray`, `ndarray`) and saves it as numpy arrays. So it may be
very hard to deserialize objects on a different version of Theano.
But tt is useful when you would like to resume an experiment on a different
kind of hardware.
This type of serialization uses some helper functions particular to Theano. It
serializes the object using Python's pickling protocol, but any ``ndarray`` or
``CudaNdarray`` objects contained within the object are saved separately as NPY
files. These NPY files and the Pickled file are all saved together in single
ZIP-file.
Another use case of this type of serialization is to use parameters for another
model after pretraining, fixing bugs or minor changes in it. You can still
load the parameters manually with `numpy`:
The main advantage of this approach is that you don't even need Theano installed
in order to look at the values of shared variables that you pickled. You can
just load the parameters manually with `numpy`.
.. code-block:: python
numpy.load('model.zip')
This approach could be beneficial if you are sharing your model with people who
might not have Theano installed, who are using a different Python version, or if
you are planning to save your model for a long time (in which case version
mismatches might make it difficult to unpickle objects).
.. autofunction:: theano.misc.pkl_utils.dump
.. autofunction:: theano.misc.pkl_utils.load
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论