Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
ef854897
提交
ef854897
authored
1月 17, 2021
作者:
Brandon T. Willard
提交者:
Thomas Wiecki
1月 27, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Rename theano.tensor.nnet.nnet to theano.tensor.nnet.basic
上级
77835528
隐藏空白字符变更
内嵌
并排
正在显示
10 个修改的文件
包含
25 行增加
和
25 行删除
+25
-25
basic.txt
doc/library/tensor/nnet/basic.txt
+3
-3
test_basic.py
tests/tensor/nnet/test_basic.py
+1
-1
test_mlp.py
tests/tensor/test_mlp.py
+1
-1
profiling.py
theano/compile/profiling.py
+1
-1
configdefaults.py
theano/configdefaults.py
+1
-1
dnn_opt.py
theano/gpuarray/dnn_opt.py
+1
-1
opt.py
theano/gpuarray/opt.py
+12
-12
jax_dispatch.py
theano/link/jax/jax_dispatch.py
+1
-1
__init__.py
theano/tensor/nnet/__init__.py
+2
-2
basic.py
theano/tensor/nnet/basic.py
+2
-2
没有找到文件。
doc/library/tensor/nnet/
nnet
.txt
→
doc/library/tensor/nnet/
basic
.txt
浏览文件 @
ef854897
.. _libdoc_tensor_nnet_
nnet
:
.. _libdoc_tensor_nnet_
basic
:
======================================================
======================================================
:mod:`
nnet` --
Ops for neural networks
:mod:`
basic` -- Basic
Ops for neural networks
======================================================
======================================================
.. module:: theano.tensor.nnet.
nnet
.. module:: theano.tensor.nnet.
basic
:platform: Unix, Windows
:platform: Unix, Windows
:synopsis: Ops for neural networks
:synopsis: Ops for neural networks
.. moduleauthor:: LISA
.. moduleauthor:: LISA
...
...
tests/tensor/nnet/test_
nnet
.py
→
tests/tensor/nnet/test_
basic
.py
浏览文件 @
ef854897
...
@@ -16,7 +16,7 @@ from theano.graph.fg import FunctionGraph
...
@@ -16,7 +16,7 @@ from theano.graph.fg import FunctionGraph
from
theano.graph.opt
import
check_stack_trace
from
theano.graph.opt
import
check_stack_trace
from
theano.tensor.basic
import
Argmax
from
theano.tensor.basic
import
Argmax
from
theano.tensor.elemwise
import
CAReduce
,
DimShuffle
,
Elemwise
from
theano.tensor.elemwise
import
CAReduce
,
DimShuffle
,
Elemwise
from
theano.tensor.nnet.
nnet
import
(
from
theano.tensor.nnet.
basic
import
(
CrossentropyCategorical1Hot
,
CrossentropyCategorical1Hot
,
CrossentropyCategorical1HotGrad
,
CrossentropyCategorical1HotGrad
,
CrossentropySoftmax1HotWithBiasDx
,
CrossentropySoftmax1HotWithBiasDx
,
...
...
tests/tensor/test_mlp.py
浏览文件 @
ef854897
...
@@ -12,7 +12,7 @@ import numpy as np
...
@@ -12,7 +12,7 @@ import numpy as np
import
theano
import
theano
import
theano.tensor
as
tt
import
theano.tensor
as
tt
from
theano.tensor.nnet.
nnet
import
CrossentropySoftmax1HotWithBiasDx
,
softmax
from
theano.tensor.nnet.
basic
import
CrossentropySoftmax1HotWithBiasDx
,
softmax
from
theano.tensor.type
import
ivector
,
lscalar
,
matrix
from
theano.tensor.type
import
ivector
,
lscalar
,
matrix
...
...
theano/compile/profiling.py
浏览文件 @
ef854897
...
@@ -1696,7 +1696,7 @@ class ProfileStats:
...
@@ -1696,7 +1696,7 @@ class ProfileStats:
# tip 7
# tip 7
import
theano.gpuarray
import
theano.gpuarray
import
theano.tensor.signal.pool
as
pool
import
theano.tensor.signal.pool
as
pool
from
theano.tensor.nnet.
nnet
import
LogSoftmax
from
theano.tensor.nnet.
basic
import
LogSoftmax
for
(
fgraph
,
a
)
in
self
.
apply_time
:
for
(
fgraph
,
a
)
in
self
.
apply_time
:
node
=
a
node
=
a
...
...
theano/configdefaults.py
浏览文件 @
ef854897
...
@@ -1465,7 +1465,7 @@ def add_deprecated_configvars():
...
@@ -1465,7 +1465,7 @@ def add_deprecated_configvars():
"warn__argmax_pushdown_bug"
,
"warn__argmax_pushdown_bug"
,
(
(
"Warn if in past version of Theano we generated a bug with the "
"Warn if in past version of Theano we generated a bug with the "
"theano.tensor.nnet.
nnet
.local_argmax_pushdown optimization. "
"theano.tensor.nnet.
basic
.local_argmax_pushdown optimization. "
"Was fixed 27 may 2010"
"Was fixed 27 may 2010"
),
),
BoolParam
(
_warn_default
(
"0.3"
)),
BoolParam
(
_warn_default
(
"0.3"
)),
...
...
theano/gpuarray/dnn_opt.py
浏览文件 @
ef854897
...
@@ -62,7 +62,7 @@ from theano.tensor.nnet.abstract_conv import (
...
@@ -62,7 +62,7 @@ from theano.tensor.nnet.abstract_conv import (
assert_conv_shape
,
assert_conv_shape
,
get_conv_output_shape
,
get_conv_output_shape
,
)
)
from
theano.tensor.nnet.
nnet
import
LogSoftmax
,
SoftmaxGrad
from
theano.tensor.nnet.
basic
import
LogSoftmax
,
SoftmaxGrad
from
theano.tensor.signal.pool
import
AveragePoolGrad
,
MaxPoolGrad
,
Pool
from
theano.tensor.signal.pool
import
AveragePoolGrad
,
MaxPoolGrad
,
Pool
...
...
theano/gpuarray/opt.py
浏览文件 @
ef854897
...
@@ -1480,9 +1480,9 @@ def local_gpua_tri(fgraph, op, context_name, inputs, outputs):
...
@@ -1480,9 +1480,9 @@ def local_gpua_tri(fgraph, op, context_name, inputs, outputs):
@register_opt
(
"fast_compile"
)
@register_opt
(
"fast_compile"
)
@op_lifter
([
theano
.
tensor
.
nnet
.
nnet
.
CrossentropySoftmaxArgmax1HotWithBias
])
@op_lifter
([
theano
.
tensor
.
nnet
.
basic
.
CrossentropySoftmaxArgmax1HotWithBias
])
@register_opt2
(
@register_opt2
(
[
theano
.
tensor
.
nnet
.
nnet
.
CrossentropySoftmaxArgmax1HotWithBias
],
"fast_compile"
[
theano
.
tensor
.
nnet
.
basic
.
CrossentropySoftmaxArgmax1HotWithBias
],
"fast_compile"
)
)
def
local_gpua_crossentropysoftmaxargmax1hotwithbias
(
def
local_gpua_crossentropysoftmaxargmax1hotwithbias
(
fgraph
,
op
,
context_name
,
inputs
,
outputs
fgraph
,
op
,
context_name
,
inputs
,
outputs
...
@@ -1491,9 +1491,9 @@ def local_gpua_crossentropysoftmaxargmax1hotwithbias(
...
@@ -1491,9 +1491,9 @@ def local_gpua_crossentropysoftmaxargmax1hotwithbias(
@register_opt
(
"fast_compile"
)
@register_opt
(
"fast_compile"
)
@op_lifter
([
theano
.
tensor
.
nnet
.
nnet
.
CrossentropySoftmax1HotWithBiasDx
])
@op_lifter
([
theano
.
tensor
.
nnet
.
basic
.
CrossentropySoftmax1HotWithBiasDx
])
@register_opt2
(
@register_opt2
(
[
theano
.
tensor
.
nnet
.
nnet
.
CrossentropySoftmax1HotWithBiasDx
],
"fast_compile"
[
theano
.
tensor
.
nnet
.
basic
.
CrossentropySoftmax1HotWithBiasDx
],
"fast_compile"
)
)
def
local_gpua_crossentropysoftmax1hotwithbiasdx
(
def
local_gpua_crossentropysoftmax1hotwithbiasdx
(
fgraph
,
op
,
context_name
,
inputs
,
outputs
fgraph
,
op
,
context_name
,
inputs
,
outputs
...
@@ -1502,22 +1502,22 @@ def local_gpua_crossentropysoftmax1hotwithbiasdx(
...
@@ -1502,22 +1502,22 @@ def local_gpua_crossentropysoftmax1hotwithbiasdx(
@register_opt
(
"fast_compile"
)
@register_opt
(
"fast_compile"
)
@op_lifter
([
theano
.
tensor
.
nnet
.
nnet
.
Softmax
])
@op_lifter
([
theano
.
tensor
.
nnet
.
basic
.
Softmax
])
@register_opt2
([
theano
.
tensor
.
nnet
.
nnet
.
Softmax
],
"fast_compile"
)
@register_opt2
([
theano
.
tensor
.
nnet
.
basic
.
Softmax
],
"fast_compile"
)
def
local_gpua_softmax
(
fgraph
,
op
,
context_name
,
inputs
,
outputs
):
def
local_gpua_softmax
(
fgraph
,
op
,
context_name
,
inputs
,
outputs
):
return
gpu_softmax
return
gpu_softmax
@register_opt
(
"fast_compile"
)
@register_opt
(
"fast_compile"
)
@op_lifter
([
theano
.
tensor
.
nnet
.
nnet
.
SoftmaxWithBias
])
@op_lifter
([
theano
.
tensor
.
nnet
.
basic
.
SoftmaxWithBias
])
@register_opt2
([
theano
.
tensor
.
nnet
.
nnet
.
SoftmaxWithBias
],
"fast_compile"
)
@register_opt2
([
theano
.
tensor
.
nnet
.
basic
.
SoftmaxWithBias
],
"fast_compile"
)
def
local_gpua_softmaxwithbias
(
fgraph
,
op
,
context_name
,
inputs
,
outputs
):
def
local_gpua_softmaxwithbias
(
fgraph
,
op
,
context_name
,
inputs
,
outputs
):
return
gpu_softmax_with_bias
return
gpu_softmax_with_bias
@register_opt
(
"fast_compile"
)
@register_opt
(
"fast_compile"
)
@op_lifter
([
theano
.
tensor
.
nnet
.
nnet
.
CrossentropyCategorical1Hot
])
@op_lifter
([
theano
.
tensor
.
nnet
.
basic
.
CrossentropyCategorical1Hot
])
@register_opt2
([
theano
.
tensor
.
nnet
.
nnet
.
CrossentropyCategorical1Hot
],
"fast_compile"
)
@register_opt2
([
theano
.
tensor
.
nnet
.
basic
.
CrossentropyCategorical1Hot
],
"fast_compile"
)
def
local_gpu_crossentropycategorical1hot
(
fgraph
,
op
,
context_name
,
inputs
,
outputs
):
def
local_gpu_crossentropycategorical1hot
(
fgraph
,
op
,
context_name
,
inputs
,
outputs
):
# There is no corresponding GPU Op, but we can express it as:
# There is no corresponding GPU Op, but we can express it as:
# coding, one_of_n = inputs
# coding, one_of_n = inputs
...
@@ -1528,9 +1528,9 @@ def local_gpu_crossentropycategorical1hot(fgraph, op, context_name, inputs, outp
...
@@ -1528,9 +1528,9 @@ def local_gpu_crossentropycategorical1hot(fgraph, op, context_name, inputs, outp
@register_opt
(
"fast_compile"
)
@register_opt
(
"fast_compile"
)
@op_lifter
([
theano
.
tensor
.
nnet
.
nnet
.
CrossentropyCategorical1HotGrad
])
@op_lifter
([
theano
.
tensor
.
nnet
.
basic
.
CrossentropyCategorical1HotGrad
])
@register_opt2
(
@register_opt2
(
[
theano
.
tensor
.
nnet
.
nnet
.
CrossentropyCategorical1HotGrad
],
"fast_compile"
[
theano
.
tensor
.
nnet
.
basic
.
CrossentropyCategorical1HotGrad
],
"fast_compile"
)
)
def
local_gpu_crossentropycategorical1hotgrad
(
def
local_gpu_crossentropycategorical1hotgrad
(
fgraph
,
op
,
context_name
,
inputs
,
outputs
fgraph
,
op
,
context_name
,
inputs
,
outputs
...
...
theano/link/jax/jax_dispatch.py
浏览文件 @
ef854897
...
@@ -57,7 +57,7 @@ from theano.tensor.nlinalg import (
...
@@ -57,7 +57,7 @@ from theano.tensor.nlinalg import (
QRFull
,
QRFull
,
QRIncomplete
,
QRIncomplete
,
)
)
from
theano.tensor.nnet.
nnet
import
Softmax
from
theano.tensor.nnet.
basic
import
Softmax
from
theano.tensor.nnet.sigm
import
ScalarSoftplus
from
theano.tensor.nnet.sigm
import
ScalarSoftplus
from
theano.tensor.opt
import
MakeVector
from
theano.tensor.opt
import
MakeVector
from
theano.tensor.slinalg
import
Cholesky
,
Solve
from
theano.tensor.slinalg
import
Cholesky
,
Solve
...
...
theano/tensor/nnet/__init__.py
浏览文件 @
ef854897
...
@@ -7,8 +7,7 @@ from theano.tensor.nnet.abstract_conv import (
...
@@ -7,8 +7,7 @@ from theano.tensor.nnet.abstract_conv import (
conv3d
,
conv3d
,
separable_conv2d
,
separable_conv2d
,
)
)
from
theano.tensor.nnet.bn
import
batch_normalization
from
theano.tensor.nnet.basic
import
(
from
theano.tensor.nnet.nnet
import
(
binary_crossentropy
,
binary_crossentropy
,
categorical_crossentropy
,
categorical_crossentropy
,
confusion_matrix
,
confusion_matrix
,
...
@@ -41,6 +40,7 @@ from theano.tensor.nnet.nnet import (
...
@@ -41,6 +40,7 @@ from theano.tensor.nnet.nnet import (
softmax_with_bias
,
softmax_with_bias
,
softsign
,
softsign
,
)
)
from
theano.tensor.nnet.bn
import
batch_normalization
from
theano.tensor.nnet.sigm
import
(
from
theano.tensor.nnet.sigm
import
(
hard_sigmoid
,
hard_sigmoid
,
scalar_sigmoid
,
scalar_sigmoid
,
...
...
theano/tensor/nnet/
nnet
.py
→
theano/tensor/nnet/
basic
.py
浏览文件 @
ef854897
...
@@ -926,7 +926,7 @@ def local_softmax_with_bias(fgraph, node):
...
@@ -926,7 +926,7 @@ def local_softmax_with_bias(fgraph, node):
if
sm_bias
.
type
==
node
.
outputs
[
0
]
.
type
:
if
sm_bias
.
type
==
node
.
outputs
[
0
]
.
type
:
# This condition is not always true. See the test
# This condition is not always true. See the test
# nnet/tests/test_
nnet
.py:T_SoftmaxWithBias.test_broadcast
# nnet/tests/test_
basic
.py:T_SoftmaxWithBias.test_broadcast
return
[
sm_bias
]
return
[
sm_bias
]
...
@@ -1672,7 +1672,7 @@ def local_argmax_pushdown(fgraph, node):
...
@@ -1672,7 +1672,7 @@ def local_argmax_pushdown(fgraph, node):
)
)
):
):
if
config
.
warn__argmax_pushdown_bug
:
if
config
.
warn__argmax_pushdown_bug
:
logging
.
getLogger
(
"theano.tensor.nnet.
nnet
"
)
.
warn
(
logging
.
getLogger
(
"theano.tensor.nnet.
basic
"
)
.
warn
(
"There was a bug in Theano fixed on May 27th, 2010 in this case."
"There was a bug in Theano fixed on May 27th, 2010 in this case."
" I.E. when we take the max of a softplus, softmax, exp, "
" I.E. when we take the max of a softplus, softmax, exp, "
"log, tanh, sigmoid, softmax_with_bias op, we were doing "
"log, tanh, sigmoid, softmax_with_bias op, we were doing "
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论