Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
486e2946
提交
486e2946
authored
6月 08, 2016
作者:
Caglar
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
some cosmetic changes.
上级
5bd4c316
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
7 行增加
和
6 行删除
+7
-6
sigm.py
theano/tensor/nnet/sigm.py
+7
-6
没有找到文件。
theano/tensor/nnet/sigm.py
浏览文件 @
486e2946
...
@@ -434,7 +434,7 @@ opt.register_stabilize(log1pexp_to_softplus, name='log1pexp_to_softplus')
...
@@ -434,7 +434,7 @@ opt.register_stabilize(log1pexp_to_softplus, name='log1pexp_to_softplus')
opt
.
register_stabilize
(
log1p_neg_sigmoid
,
name
=
'log1p_neg_sigmoid,'
)
opt
.
register_stabilize
(
log1p_neg_sigmoid
,
name
=
'log1p_neg_sigmoid,'
)
def
is_1pexp
(
t
):
def
is_1pexp
(
t
,
only_process_constants
=
True
):
"""
"""
Returns
Returns
...
@@ -446,8 +446,9 @@ def is_1pexp(t):
...
@@ -446,8 +446,9 @@ def is_1pexp(t):
"""
"""
if
t
.
owner
and
t
.
owner
.
op
==
tensor
.
add
:
if
t
.
owner
and
t
.
owner
.
op
==
tensor
.
add
:
scalars
,
scalar_inputs
,
nonconsts
=
\
scalars
,
scalar_inputs
,
nonconsts
=
\
opt
.
scalarconsts_rest
(
t
.
owner
.
inputs
)
opt
.
scalarconsts_rest
(
t
.
owner
.
inputs
,
# scalar_inputs are potentially dimshuffled and fill'd scalars
only_process_constants
=
only_process_constants
)
# scalar_inputs are potentially dimshuffled and filled with scalars
if
len
(
nonconsts
)
==
1
:
if
len
(
nonconsts
)
==
1
:
maybe_exp
=
nonconsts
[
0
]
maybe_exp
=
nonconsts
[
0
]
if
maybe_exp
.
owner
and
maybe_exp
.
owner
.
op
==
tensor
.
exp
:
if
maybe_exp
.
owner
and
maybe_exp
.
owner
.
op
==
tensor
.
exp
:
...
@@ -521,7 +522,7 @@ def is_mul(var):
...
@@ -521,7 +522,7 @@ def is_mul(var):
return
None
return
None
def
partition_num_or_denom
(
r
,
f
):
def
partition_num_or_denom
(
r
,
f
,
**
kwargs
):
if
r
.
owner
and
r
.
owner
.
op
==
tensor
.
mul
:
if
r
.
owner
and
r
.
owner
.
op
==
tensor
.
mul
:
a
=
r
.
owner
.
inputs
a
=
r
.
owner
.
inputs
else
:
else
:
...
@@ -532,7 +533,7 @@ def partition_num_or_denom(r, f):
...
@@ -532,7 +533,7 @@ def partition_num_or_denom(r, f):
neg
=
False
neg
=
False
rest
=
[]
rest
=
[]
for
t
in
a
:
for
t
in
a
:
f_t
=
f
(
t
)
f_t
=
f
(
t
,
**
kwargs
)
if
f_t
is
None
:
if
f_t
is
None
:
rest
.
append
(
t
)
rest
.
append
(
t
)
else
:
else
:
...
@@ -956,7 +957,7 @@ def local_inv_1_plus_exp(node):
...
@@ -956,7 +957,7 @@ def local_inv_1_plus_exp(node):
inv_arg
=
node
.
inputs
[
0
]
inv_arg
=
node
.
inputs
[
0
]
if
inv_arg
.
owner
and
inv_arg
.
owner
.
op
==
tensor
.
add
:
if
inv_arg
.
owner
and
inv_arg
.
owner
.
op
==
tensor
.
add
:
scalars
,
scalar_inputs
,
nonconsts
=
\
scalars
,
scalar_inputs
,
nonconsts
=
\
opt
.
scalarconsts_rest
(
inv_arg
.
owner
.
inputs
)
opt
.
scalarconsts_rest
(
inv_arg
.
owner
.
inputs
,
only_process_constants
=
True
)
# scalar_inputs are potentially dimshuffled and fill'd scalars
# scalar_inputs are potentially dimshuffled and fill'd scalars
if
len
(
nonconsts
)
==
1
:
if
len
(
nonconsts
)
==
1
:
if
nonconsts
[
0
]
.
owner
and
nonconsts
[
0
]
.
owner
.
op
==
tensor
.
exp
:
if
nonconsts
[
0
]
.
owner
and
nonconsts
[
0
]
.
owner
.
op
==
tensor
.
exp
:
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论