提交 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.
sparse/sandbox
scalar/index
gof/index
misc/pkl_utils
scan
sandbox/index
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
====================
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
deserialize objects on a different version of Theano. It is useful when you
would like to resume an experiment on a different kind of hardware.
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.
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
......
......@@ -36,4 +36,3 @@ def test_dump_load_mrg():
rng = load(f)
assert type(rng) == MRG_RandomStreams
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论