Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
e6fe58c3
提交
e6fe58c3
authored
4月 18, 2008
作者:
Olivier Breuleux
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fixed README and gradient doc
上级
0ebe2132
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
6 行增加
和
24 行删除
+6
-24
README.1st
README.1st
+1
-1
gradient.py
gradient.py
+5
-23
没有找到文件。
README.1st
浏览文件 @
e6fe58c3
THEANO
THEANO
Documentation et al is in Trac:
Documentation et al is in Trac:
http://lgcm
:8000/testenv
/wiki/WikiStart
http://lgcm
.iro.umontreal.ca:8000/theano
/wiki/WikiStart
The lisa twiki is deprecated for documenting Theano.
The lisa twiki is deprecated for documenting Theano.
...
...
gradient.py
浏览文件 @
e6fe58c3
...
@@ -27,27 +27,14 @@ def grad_sources_inputs(sources, graph_inputs):
...
@@ -27,27 +27,14 @@ def grad_sources_inputs(sources, graph_inputs):
calling L{Op.grad}(...) when it is provided by an L{Op}, and at least one of the
calling L{Op.grad}(...) when it is provided by an L{Op}, and at least one of the
outputs of the L{Op} has an associated gradient.
outputs of the L{Op} has an associated gradient.
The L{Op.grad}(...) functions may be called in several ways (for the
The L{Op.grad}(...) functions are called as such:
convenience of the L{Op} implementer) depending on the number of inputs and
outputs.
If there is one input and one output::
op.grad( op.inputs[0], grad(op.outputs[0]))
op.grad( op.inputs[0], grad(op.outputs[0]))
If there are several inputs and one output::
op.grad( op.inputs, grad(op.outputs[0]))
If there is one input and several outputs::
op.grad( op.inputs[0], [grad(o) for o in op.outputs[0]])
If there are multiple inputs and outputs::
op.grad( op.inputs, [grad(o) for o in op.outputs[0]])
This function expects the L{Op.grad}(...) function to return the gradient
This function expects the L{Op.grad}(...) function to return the gradient
expression [results] associated with the inputs of the L{Op}.
If the L{Op} has a
expression [results] associated with the inputs of the L{Op}.
The L{Op} should
single input, it should return a single result; if the L{Op} has multiple
return a list of results corresponding to the gradients in the same order
inputs, it should return a list of results corresponding to the gradients in
as the inputs. If it has a single output it should return a list or tuple
the same order as the inputs
.
of length 1
.
For each input wrt to which an L{Op} is not differentiable, it should return
For each input wrt to which an L{Op} is not differentiable, it should return
None instead of a result instance.
None instead of a result instance.
...
@@ -78,9 +65,6 @@ def grad_sources_inputs(sources, graph_inputs):
...
@@ -78,9 +65,6 @@ def grad_sources_inputs(sources, graph_inputs):
#if all output gradients are None, continue
#if all output gradients are None, continue
if
all
(
map
(
lambda
x
:
x
is
None
,
g_outputs
)):
continue
if
all
(
map
(
lambda
x
:
x
is
None
,
g_outputs
)):
continue
# output_arg = _unpack_result(g_outputs)
# input_arg = _unpack_result(op.inputs)
output_arg
=
g_outputs
output_arg
=
g_outputs
input_arg
=
op
.
inputs
input_arg
=
op
.
inputs
...
@@ -90,8 +74,6 @@ def grad_sources_inputs(sources, graph_inputs):
...
@@ -90,8 +74,6 @@ def grad_sources_inputs(sources, graph_inputs):
except
AttributeError
:
except
AttributeError
:
dinputs
=
[]
dinputs
=
[]
# input_arg = [input in dinputs and input.copy() or input for input in input_arg]
new_input_arg
=
[]
new_input_arg
=
[]
for
input
in
input_arg
:
for
input
in
input_arg
:
if
input
in
dinputs
:
if
input
in
dinputs
:
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论