Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
da82bf80
提交
da82bf80
authored
2月 17, 2009
作者:
Joseph Turian
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Added doc/extending.txt
上级
4aa1cd31
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
44 行增加
和
2 行删除
+44
-2
extending.txt
doc/doc/extending.txt
+40
-0
index.txt
doc/doc/index.txt
+3
-1
tutorial.txt
doc/doc/tutorial.txt
+1
-1
没有找到文件。
doc/doc/extending.txt
0 → 100644
浏览文件 @
da82bf80
================
Extending theano
================
This page introduces some important terminology for describing how theano
works. Below there is a list of HOWTO documents for extending theano.
Lets start by looking at what happens in a simple theano program.
.. code-block:: python
#!python
x = tensor.matrix('x')
y = tensor.matrix('y')
z = x + y
f = theano.function(input=[x,y], output=z, mode='FAST_RUN')
print f(numpy.ones(2,3), numpy.ones(2,3))
The first three lines build a graph_ whose nodes correspond to variables (``x,y,z``) and expressions (just the '+' here).
The variables in such a graph are Result_ instances of some Type_, and the expressions are Apply_ instances of some Op_.
The line ``f = theano.function([x,y], [z], mode='FAST_RUN')`` compiles_
the graph we built and returns a function_ whose ``__call__`` method
takes as arguments the values to use for ``x`` and ``y``.
The mode_ controls which transformations_ are applied to the graph as we compile it.
The line ``print f(numpy.ones(2,3), numpy.ones(2,3))`` creates two
matrices, and then uses f's ``__call__`` method to run the compiled
function on those inputs.
The compiled function is executed by a linker_, which was also specified by the mode_ argument to ``function``.
The instance f's ``__call__`` method returns a value for ``z`` (given ``x,y``) which we print.
Theano was designed to be extensible to new types_ of Result, new Ops_ to use in symbolic computations,
and new modes of compilation and execution. When you're comfortable with the material above, move on to:
* HowtoCreateType create a new data type,
* HowtoCreateOp create a new type of Op,
* HowtoAddTransformation add a transformation to an existing transformation mode,
* Create a new mode by HowtoCreateLinker creating a new linker, or HowtoCreateTransformationMode create a new transformation mode.
doc/doc/index.txt
浏览文件 @
da82bf80
...
...
@@ -37,7 +37,7 @@ Using Theano
.. _Howto:
.. _theano-users: http://groups.google.com/group/theano-users?pli=1
.. _theano-dev: http://groups.google.com/group/theano-dev?pli=1
.. _
n00b guide: n00b
.html
.. _
tutorial: tutorial
.html
.. _glossary of terminology: ../api/term-index.html
.. _typelist: typelist.html
.. _oplist: oplist.html
...
...
@@ -48,6 +48,8 @@ Extending Theano
- Read about `How Theano Works <UserAdvanced.html>`__. This introduces the
major interface data structures: Op, Type, Result, Apply.
- Read about `Extending theano <extending.html>`__.
- How to make a new Op.
- How to make a new Optimization.
...
...
doc/doc/tutorial.txt
浏览文件 @
da82bf80
...
...
@@ -87,7 +87,7 @@ and we are working hard to make these problems errors easier to fix.
*It would be worth thinking through the order in which these terms should be introduced.
Can we inline the text?'''*
*Note: Theano has two types of
[DefineScalar scalar]
.*
*Note: Theano has two types of
scalar_
.*
Matrix example
==============
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论