Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
ddacf685
提交
ddacf685
authored
7月 21, 2015
作者:
Frédéric Bastien
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #3179 from harlouci/props_sparse_sandbox
Props sparse sandbox
上级
f40bf432
7e1277e1
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
4 行增加
和
27 行删除
+4
-27
sp.py
theano/sparse/sandbox/sp.py
+1
-0
sp2.py
theano/sparse/sandbox/sp2.py
+3
-27
没有找到文件。
theano/sparse/sandbox/sp.py
浏览文件 @
ddacf685
...
@@ -41,6 +41,7 @@ class ConvolutionIndices(Op):
...
@@ -41,6 +41,7 @@ class ConvolutionIndices(Op):
patch. Convolution is then simply the dot product of (img x M)
patch. Convolution is then simply the dot product of (img x M)
and the kernels.
and the kernels.
"""
"""
__props__
=
()
@staticmethod
@staticmethod
def
sparse_eval
(
inshp
,
kshp
,
nkern
,
strides
=
(
1
,
1
),
mode
=
'valid'
):
def
sparse_eval
(
inshp
,
kshp
,
nkern
,
strides
=
(
1
,
1
),
mode
=
'valid'
):
...
...
theano/sparse/sandbox/sp2.py
浏览文件 @
ddacf685
...
@@ -61,12 +61,7 @@ class Poisson(gof.op.Op):
...
@@ -61,12 +61,7 @@ class Poisson(gof.op.Op):
:return: A sparse matrix of random integers of a Poisson density
:return: A sparse matrix of random integers of a Poisson density
with mean of `x` element wise.
with mean of `x` element wise.
"""
"""
__props__
=
()
def
__eq__
(
self
,
other
):
return
(
type
(
self
)
==
type
(
other
))
def
__hash__
(
self
):
return
hash
(
type
(
self
))
def
make_node
(
self
,
x
):
def
make_node
(
self
,
x
):
x
=
as_sparse_variable
(
x
)
x
=
as_sparse_variable
(
x
)
...
@@ -91,8 +86,6 @@ class Poisson(gof.op.Op):
...
@@ -91,8 +86,6 @@ class Poisson(gof.op.Op):
def
infer_shape
(
self
,
node
,
ins_shapes
):
def
infer_shape
(
self
,
node
,
ins_shapes
):
return
ins_shapes
return
ins_shapes
def
__str__
(
self
):
return
self
.
__class__
.
__name__
poisson
=
Poisson
()
poisson
=
Poisson
()
...
@@ -112,19 +105,12 @@ class Binomial(gof.op.Op):
...
@@ -112,19 +105,12 @@ class Binomial(gof.op.Op):
:return: A sparse matrix of integers representing the number
:return: A sparse matrix of integers representing the number
of success.
of success.
"""
"""
__props__
=
(
"format"
,
"dtype"
)
def
__init__
(
self
,
format
,
dtype
):
def
__init__
(
self
,
format
,
dtype
):
self
.
format
=
format
self
.
format
=
format
self
.
dtype
=
dtype
self
.
dtype
=
dtype
def
__eq__
(
self
,
other
):
return
((
type
(
self
)
==
type
(
other
))
and
self
.
format
==
other
.
format
and
self
.
dtype
==
other
.
dtype
)
def
__hash__
(
self
):
return
hash
(
type
(
self
))
^
hash
(
self
.
format
)
^
hash
(
self
.
dtype
)
def
make_node
(
self
,
n
,
p
,
shape
):
def
make_node
(
self
,
n
,
p
,
shape
):
n
=
tensor
.
as_tensor_variable
(
n
)
n
=
tensor
.
as_tensor_variable
(
n
)
p
=
tensor
.
as_tensor_variable
(
p
)
p
=
tensor
.
as_tensor_variable
(
p
)
...
@@ -159,9 +145,6 @@ class Binomial(gof.op.Op):
...
@@ -159,9 +145,6 @@ class Binomial(gof.op.Op):
def
infer_shape
(
self
,
node
,
ins_shapes
):
def
infer_shape
(
self
,
node
,
ins_shapes
):
return
[(
node
.
inputs
[
2
][
0
],
node
.
inputs
[
2
][
1
])]
return
[(
node
.
inputs
[
2
][
0
],
node
.
inputs
[
2
][
1
])]
def
__str__
(
self
):
return
self
.
__class__
.
__name__
csr_fbinomial
=
Binomial
(
'csr'
,
'float32'
)
csr_fbinomial
=
Binomial
(
'csr'
,
'float32'
)
csc_fbinomial
=
Binomial
(
'csc'
,
'float32'
)
csc_fbinomial
=
Binomial
(
'csc'
,
'float32'
)
csr_dbinomial
=
Binomial
(
'csr'
,
'float64'
)
csr_dbinomial
=
Binomial
(
'csr'
,
'float64'
)
...
@@ -189,12 +172,7 @@ class Multinomial(gof.op.Op):
...
@@ -189,12 +172,7 @@ class Multinomial(gof.op.Op):
:note: It will works only if `p` have csr format.
:note: It will works only if `p` have csr format.
"""
"""
__props__
=
()
def
__eq__
(
self
,
other
):
return
(
type
(
self
)
==
type
(
other
))
def
__hash__
(
self
):
return
hash
(
type
(
self
))
def
make_node
(
self
,
n
,
p
):
def
make_node
(
self
,
n
,
p
):
n
=
tensor
.
as_tensor_variable
(
n
)
n
=
tensor
.
as_tensor_variable
(
n
)
...
@@ -238,6 +216,4 @@ class Multinomial(gof.op.Op):
...
@@ -238,6 +216,4 @@ class Multinomial(gof.op.Op):
def
infer_shape
(
self
,
node
,
ins_shapes
):
def
infer_shape
(
self
,
node
,
ins_shapes
):
return
[
ins_shapes
[
1
]]
return
[
ins_shapes
[
1
]]
def
__str__
(
self
):
return
self
.
__class__
.
__name__
multinomial
=
Multinomial
()
multinomial
=
Multinomial
()
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论