Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
1cb731e4
提交
1cb731e4
authored
2月 11, 2016
作者:
hantek
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
sloving test failures
上级
1d017d25
显示空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
12 行增加
和
16 行删除
+12
-16
extending_theano.txt
doc/extending/extending_theano.txt
+6
-10
examples.txt
doc/tutorial/examples.txt
+5
-5
profiling.txt
doc/tutorial/profiling.txt
+1
-1
没有找到文件。
doc/extending/extending_theano.txt
浏览文件 @
1cb731e4
...
@@ -412,8 +412,9 @@ but it must not influence the semantics of the Op output.
...
@@ -412,8 +412,9 @@ but it must not influence the semantics of the Op output.
You can try the new Op as follows:
You can try the new Op as follows:
.. testcode:: example
(Using make_node)
.. testcode:: example
import theano
x = theano.tensor.matrix()
x = theano.tensor.matrix()
f = theano.function([x], DoubleOp1()(x))
f = theano.function([x], DoubleOp1()(x))
import numpy
import numpy
...
@@ -427,9 +428,6 @@ You can try the new Op as follows:
...
@@ -427,9 +428,6 @@ You can try the new Op as follows:
:hide:
:hide:
:options: +ELLIPSIS
:options: +ELLIPSIS
...
...
.. code-block:: none
.. code-block:: none
[[ 0.08257206 0.34308357 0.5288043 0.06582951]
[[ 0.08257206 0.34308357 0.5288043 0.06582951]
...
@@ -443,8 +441,9 @@ You can try the new Op as follows:
...
@@ -443,8 +441,9 @@ You can try the new Op as follows:
[ 1.5465443 1.30803715 1.53125983 1.88291403]
[ 1.5465443 1.30803715 1.53125983 1.88291403]
[ 1.6904152 0.61000201 1.76861002 1.9163731 ]]
[ 1.6904152 0.61000201 1.76861002 1.9163731 ]]
.. testcode:: example
(Using itypes and otypes)
.. testcode:: example
import theano
x = theano.tensor.matrix()
x = theano.tensor.matrix()
f = theano.function([x], DoubleOp2()(x))
f = theano.function([x], DoubleOp2()(x))
import numpy
import numpy
...
@@ -459,9 +458,6 @@ You can try the new Op as follows:
...
@@ -459,9 +458,6 @@ You can try the new Op as follows:
:hide:
:hide:
:options: +ELLIPSIS
:options: +ELLIPSIS
...
...
.. code-block:: none
.. code-block:: none
[[ 0.02443785 0.67833979 0.91954769 0.95444365]
[[ 0.02443785 0.67833979 0.91954769 0.95444365]
...
@@ -503,8 +499,8 @@ and ``b`` are equal.
...
@@ -503,8 +499,8 @@ and ``b`` are equal.
def make_node(self, x):
def make_node(self, x):
# check that the theano version has support for __props__.
# check that the theano version has support for __props__.
assert hasattr(self, '_props'),
"Your version of theano is too old
assert hasattr(self, '_props'),
("Your version of theano is too"
to support __props__."
"old to support __props__.")
x = theano.tensor.as_tensor_variable(x)
x = theano.tensor.as_tensor_variable(x)
return theano.Apply(self, [x], [x.type()])
return theano.Apply(self, [x], [x.type()])
...
...
doc/tutorial/examples.txt
浏览文件 @
1cb731e4
...
@@ -116,7 +116,7 @@ one. You can do it like this:
...
@@ -116,7 +116,7 @@ one. You can do it like this:
>>> from theano import function
>>> from theano import function
>>> x, y = T.dscalars('x', 'y')
>>> x, y = T.dscalars('x', 'y')
>>> z = x + y
>>> z = x + y
>>> f = function([x, In(y,
default
=1)], z)
>>> f = function([x, In(y,
value
=1)], z)
>>> f(33)
>>> f(33)
array(34.0)
array(34.0)
>>> f(33, 2)
>>> f(33, 2)
...
@@ -125,7 +125,7 @@ array(35.0)
...
@@ -125,7 +125,7 @@ array(35.0)
This makes use of the :ref:`In <function_inputs>` class which allows
This makes use of the :ref:`In <function_inputs>` class which allows
you to specify properties of your function's parameters with greater detail. Here we
you to specify properties of your function's parameters with greater detail. Here we
give a default value of 1 for *y* by creating a ``In`` instance with
give a default value of 1 for *y* by creating a ``In`` instance with
its ``
default
`` field set to 1.
its ``
value
`` field set to 1.
Inputs with default values must follow inputs without default
Inputs with default values must follow inputs without default
values (like Python's functions). There can be multiple inputs with default values. These parameters can
values (like Python's functions). There can be multiple inputs with default values. These parameters can
...
@@ -137,7 +137,7 @@ be set positionally or by name, as in standard Python:
...
@@ -137,7 +137,7 @@ be set positionally or by name, as in standard Python:
>>> x, y, w = T.dscalars('x', 'y', 'w')
>>> x, y, w = T.dscalars('x', 'y', 'w')
>>> z = (x + y) * w
>>> z = (x + y) * w
>>> f = function([x, In(y,
default=1), In(w, default
=2, name='w_by_name')], z)
>>> f = function([x, In(y,
value=1), In(w, value
=2, name='w_by_name')], z)
>>> f(33)
>>> f(33)
array(68.0)
array(68.0)
>>> f(33, 2)
>>> f(33, 2)
...
@@ -154,8 +154,8 @@ array(33.0)
...
@@ -154,8 +154,8 @@ array(33.0)
that are passed as arguments. The symbolic variable objects have name
that are passed as arguments. The symbolic variable objects have name
attributes (set by ``dscalars`` in the example above) and *these* are the
attributes (set by ``dscalars`` in the example above) and *these* are the
names of the keyword parameters in the functions that we build. This is
names of the keyword parameters in the functions that we build. This is
the mechanism at work in ``In(y,
default
=1)``. In the case of ``In(w,
the mechanism at work in ``In(y,
value
=1)``. In the case of ``In(w,
default
=2, name='w_by_name')``. We override the symbolic variable's name
value
=2, name='w_by_name')``. We override the symbolic variable's name
attribute with a name to be used for this function.
attribute with a name to be used for this function.
...
...
doc/tutorial/profiling.txt
浏览文件 @
1cb731e4
...
@@ -33,7 +33,7 @@ functions using either of the following two options:
...
@@ -33,7 +33,7 @@ functions using either of the following two options:
- You can also combine the profile of many functions:
- You can also combine the profile of many functions:
.. testcode::
.. testcode::
:hide:
profile = theano.compile.ProfileStats()
profile = theano.compile.ProfileStats()
f = theano.function(..., profile=profile)
f = theano.function(..., profile=profile)
g = theano.function(..., profile=profile)
g = theano.function(..., profile=profile)
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论