提交 9cdbcdb4 authored 作者: serdyuk's avatar serdyuk

Added dump/load into library documentation

FLAKE8
上级 16acde8e
...@@ -20,6 +20,7 @@ Types and Ops that you can use to build and compile expression graphs. ...@@ -20,6 +20,7 @@ Types and Ops that you can use to build and compile expression graphs.
sparse/sandbox sparse/sandbox
scalar/index scalar/index
gof/index gof/index
misc/pkl_utils
scan scan
sandbox/index sandbox/index
typed_list typed_list
......
.. _libdoc_misc:
================================================
:mod:`misc.pkl_utils` - Tools for serialization.
================================================
.. autofunction:: theano.misc.pkl_utils.dump
.. autofunction:: theano.misc.pkl_utils.load
.. seealso::
:ref:`tutorial_loadsave`
...@@ -118,9 +118,18 @@ Robust Serialization ...@@ -118,9 +118,18 @@ Robust Serialization
==================== ====================
This type of serialization internally uses pickling but extracts values of all This type of serialization internally uses pickling but extracts values of all
shared variables and saves it as numpy arrays. So it may be very hard to arrays (`CudaNdarray`, `ndarray`) and saves it as numpy arrays. So it may be
deserialize objects on a different version of Theano. It is useful when you very hard to deserialize objects on a different version of Theano.
would like to resume an experiment on a different kind of hardware. But tt is useful when you would like to resume an experiment on a different
kind of hardware.
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`:
.. code-block:: python
numpy.load('model.zip')
.. autofunction:: theano.misc.pkl_utils.dump .. autofunction:: theano.misc.pkl_utils.dump
......
...@@ -36,4 +36,3 @@ def test_dump_load_mrg(): ...@@ -36,4 +36,3 @@ def test_dump_load_mrg():
rng = load(f) rng = load(f)
assert type(rng) == MRG_RandomStreams assert type(rng) == MRG_RandomStreams
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论