Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
1464665f
提交
1464665f
authored
3月 11, 2009
作者:
Joseph Turian
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Began updating tutorial
上级
50daaf79
显示空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
21 行增加
和
20 行删除
+21
-20
adding.txt
doc/tutorials/basic/adding.txt
+20
-19
index.txt
doc/tutorials/basic/index.txt
+1
-1
没有找到文件。
doc/tutorials/basic/adding.txt
浏览文件 @
1464665f
...
...
@@ -37,19 +37,15 @@ objects).
>>> x = T.dscalar('x')
>>> y = T.dscalar('y')
In Theano, all symbols must be typed. In particular, ``T.dscalar`` is
the type we assign to "0-dimensional arrays of doubles". It is a
Theano :term:`Type`. Therefore, you can guess that by calling
``T.dscalar`` with a string argument, you create a :term:`Result`
representing a floating-point scalar quantity with the given name (if
you provide no argument, the symbol will be unnamed, which can cause
difficulties in debugging).
Note that ``dscalar`` is not a class and that therefore neither ``x``
nor ``y`` are actually instances of ``dscalar``. They are instances of
:api:`TensorResult <theano.tensor.basic.TensorResult>`. It is however
assigned the theano Type ``dscalar`` in its ``type`` field, as you can
see here:
In Theano, all symbols must be typed. In particular, ``T.dscalar``
is the type we assign to "0-dimensional arrays (`scalar`) of doubles
(`d`)". It is a Theano :term:`Type`.
``dscalar`` is not a class. Therefore, neither ``x`` nor ``y``
are actually instances of ``dscalar``. They are instances of
:api:`TensorResult <theano.tensor.basic.TensorResult>`. ``x`` and ``y``
are, however, assigned the theano Type ``dscalar`` in their ``type``
field, as you can see here:
>>> type(x)
<class 'theano.tensor.basic.TensorResult'>
...
...
@@ -60,9 +56,14 @@ Tensor(float64, scalar)
>>> x.type == T.dscalar
True
Ditto for ``y``. You may
learn more about the structures in Theano in
You can
learn more about the structures in Theano in
the :ref:`advtutorial` and in :ref:`graphstructures`.
By calling ``T.dscalar`` with a string argument, you create a
:term:`Result` representing a floating-point scalar quantity with the
given name. If you provide no argument, the symbol will be unnamed. Names
are not require, but they can aid debugging.
-------------------------------------------
**Step 2**
...
...
@@ -83,14 +84,14 @@ x + y
**Step 3**
The last step is to create a function taking ``x`` and ``y`` as inputs
and giving
out
``z`` as output:
and giving ``z`` as output:
>>> f = function([x, y], z)
The first argument to ``function`` is a list of :term:`Results
<Result>` that will be provided as inputs to the function. The second
argument is a single Result that we want to see as output *or* a list
of output results
.
The first argument to ``function`` is a list of :term:`Results
<Result>`
that will be provided as inputs to the function. The second argument
is a single Result *or* a list of Results. For either case, the second
argument is what we want to see as output when we apply the function
.
``f`` may then be used like a normal Python function.
...
...
doc/tutorials/basic/index.txt
浏览文件 @
1464665f
...
...
@@ -17,7 +17,7 @@ installed:
>>> from theano import *
Many of symbols you will need to use
li
e in the ``tensor`` subpackage
Many of symbols you will need to use
ar
e in the ``tensor`` subpackage
of theano. Let's import that subpackage under a handy name. I like
``T``.
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论