Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
839043bb
提交
839043bb
authored
4月 27, 2015
作者:
Bart van Merrienboer
提交者:
serdyuk
4月 29, 2015
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Slight doc rewrite
上级
acd4da11
显示空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
13 行增加
和
8 行删除
+13
-8
loading_and_saving.txt
doc/tutorial/loading_and_saving.txt
+13
-8
没有找到文件。
doc/tutorial/loading_and_saving.txt
浏览文件 @
839043bb
...
...
@@ -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 hardwar
e.
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-fil
e.
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
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论