Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
7dca3e80
提交
7dca3e80
authored
2月 09, 2010
作者:
Frederic Bastien
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
better printing of some op.
上级
f5788c09
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
18 行增加
和
0 行删除
+18
-0
basic.py
theano/tensor/basic.py
+3
-0
nnet.py
theano/tensor/nnet/nnet.py
+15
-0
没有找到文件。
theano/tensor/basic.py
浏览文件 @
7dca3e80
...
@@ -2900,6 +2900,9 @@ class ARange(Op):
...
@@ -2900,6 +2900,9 @@ class ARange(Op):
def
__hash__
(
self
):
def
__hash__
(
self
):
return
hash
(
self
.
dtype
)
return
hash
(
self
.
dtype
)
def
__str__
(
self
):
return
self
.
__class__
.
__name__
def
make_node
(
self
,
start
,
stop
,
step
):
def
make_node
(
self
,
start
,
stop
,
step
):
start
,
stop
,
step
=
map
(
as_tensor_variable
,
(
start
,
stop
,
step
))
start
,
stop
,
step
=
map
(
as_tensor_variable
,
(
start
,
stop
,
step
))
assert
start
.
ndim
==
0
assert
start
.
ndim
==
0
...
...
theano/tensor/nnet/nnet.py
浏览文件 @
7dca3e80
...
@@ -114,6 +114,8 @@ class SoftmaxWithBias(gof.Op):
...
@@ -114,6 +114,8 @@ class SoftmaxWithBias(gof.Op):
return
type
(
self
)
==
type
(
other
)
return
type
(
self
)
==
type
(
other
)
def
__hash__
(
self
):
def
__hash__
(
self
):
return
tensor
.
hashtype
(
self
)
return
tensor
.
hashtype
(
self
)
def
__str__
(
self
):
return
self
.
__class__
.
__name__
def
make_node
(
self
,
x
,
b
):
def
make_node
(
self
,
x
,
b
):
x
=
tensor
.
as_tensor_variable
(
x
)
x
=
tensor
.
as_tensor_variable
(
x
)
...
@@ -284,6 +286,9 @@ class SoftmaxGrad(gof.Op):
...
@@ -284,6 +286,9 @@ class SoftmaxGrad(gof.Op):
def
__hash__
(
self
):
def
__hash__
(
self
):
return
tensor
.
hashtype
(
self
)
return
tensor
.
hashtype
(
self
)
def
__str__
(
self
):
return
self
.
__class__
.
__name__
def
make_node
(
self
,
dy
,
sm
,
**
kwargs
):
def
make_node
(
self
,
dy
,
sm
,
**
kwargs
):
dy
=
tensor
.
as_tensor_variable
(
dy
)
dy
=
tensor
.
as_tensor_variable
(
dy
)
sm
=
tensor
.
as_tensor_variable
(
sm
)
sm
=
tensor
.
as_tensor_variable
(
sm
)
...
@@ -376,6 +381,8 @@ class Softmax(gof.Op):
...
@@ -376,6 +381,8 @@ class Softmax(gof.Op):
return
type
(
self
)
==
type
(
other
)
return
type
(
self
)
==
type
(
other
)
def
__hash__
(
self
):
def
__hash__
(
self
):
return
hash
(
type
(
self
))
return
hash
(
type
(
self
))
def
__str__
(
self
):
return
self
.
__class__
.
__name__
def
make_node
(
self
,
x
):
def
make_node
(
self
,
x
):
x
=
tensor
.
as_tensor_variable
(
x
)
x
=
tensor
.
as_tensor_variable
(
x
)
...
@@ -818,6 +825,8 @@ class CrossentropyCategorical1HotGrad(gof.Op):
...
@@ -818,6 +825,8 @@ class CrossentropyCategorical1HotGrad(gof.Op):
return
type
(
self
)
==
type
(
other
)
return
type
(
self
)
==
type
(
other
)
def
__hash__
(
self
):
def
__hash__
(
self
):
return
tensor
.
hashtype
(
self
)
return
tensor
.
hashtype
(
self
)
def
__str__
(
self
):
return
self
.
__class__
.
__name__
def
make_node
(
self
,
g_y
,
coding_dist
,
true_one_of_n
):
def
make_node
(
self
,
g_y
,
coding_dist
,
true_one_of_n
):
return
gof
.
Apply
(
self
,
[
g_y
,
coding_dist
,
true_one_of_n
],
[
coding_dist
.
type
()])
return
gof
.
Apply
(
self
,
[
g_y
,
coding_dist
,
true_one_of_n
],
[
coding_dist
.
type
()])
def
perform
(
self
,
node
,
(
g_y
,
coding_dist
,
true_one_of_n
),
(
g_coding_strg
,)):
def
perform
(
self
,
node
,
(
g_y
,
coding_dist
,
true_one_of_n
),
(
g_coding_strg
,)):
...
@@ -848,6 +857,8 @@ class CrossentropyCategorical1Hot(gof.Op):
...
@@ -848,6 +857,8 @@ class CrossentropyCategorical1Hot(gof.Op):
return
type
(
self
)
==
type
(
other
)
return
type
(
self
)
==
type
(
other
)
def
__hash__
(
self
):
def
__hash__
(
self
):
return
tensor
.
hashtype
(
self
)
return
tensor
.
hashtype
(
self
)
def
__str__
(
self
):
return
self
.
__class__
.
__name__
def
make_node
(
self
,
coding_dist
,
true_one_of_n
):
def
make_node
(
self
,
coding_dist
,
true_one_of_n
):
"""
"""
:type coding_dist: dense matrix
:type coding_dist: dense matrix
...
@@ -1346,6 +1357,8 @@ class Prepend_scalar_constant_to_each_row(gof.Op):
...
@@ -1346,6 +1357,8 @@ class Prepend_scalar_constant_to_each_row(gof.Op):
return
(
type
(
self
)
==
type
(
other
))
and
(
self
.
val
==
other
.
val
)
return
(
type
(
self
)
==
type
(
other
))
and
(
self
.
val
==
other
.
val
)
def
__hash__
(
self
):
def
__hash__
(
self
):
return
tensor
.
hashtype
(
self
)
^
hash
(
self
.
val
.
value
)
return
tensor
.
hashtype
(
self
)
^
hash
(
self
.
val
.
value
)
def
__str__
(
self
):
return
'
%
s{
%
s}'
%
(
self
.
__class__
.
__name__
,
self
.
val
)
def
make_node
(
self
,
mat
):
def
make_node
(
self
,
mat
):
#check type of input
#check type of input
...
@@ -1383,6 +1396,8 @@ class Prepend_scalar_to_each_row(gof.Op):
...
@@ -1383,6 +1396,8 @@ class Prepend_scalar_to_each_row(gof.Op):
return
(
type
(
self
)
==
type
(
other
))
return
(
type
(
self
)
==
type
(
other
))
def
__hash__
(
self
):
def
__hash__
(
self
):
return
tensor
.
hashtype
(
self
)
return
tensor
.
hashtype
(
self
)
def
__str__
(
self
):
return
self
.
__class__
.
__name__
def
make_node
(
self
,
val
,
mat
):
def
make_node
(
self
,
val
,
mat
):
#check type of input
#check type of input
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论