Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
c5e8a93c
提交
c5e8a93c
authored
7月 21, 2015
作者:
Frédéric Bastien
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #3181 from harlouci/props_sandbox
Props sandbox
上级
fe50c105
fa7441f7
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
14 行增加
和
44 行删除
+14
-44
fourier.py
theano/sandbox/fourier.py
+4
-11
multinomial.py
theano/sandbox/multinomial.py
+2
-6
neighbourhoods.py
theano/sandbox/neighbourhoods.py
+4
-14
rng_mrg.py
theano/sandbox/rng_mrg.py
+4
-13
没有找到文件。
theano/sandbox/fourier.py
浏览文件 @
c5e8a93c
...
@@ -11,6 +11,9 @@ from theano.gof import Op, Apply, generic
...
@@ -11,6 +11,9 @@ from theano.gof import Op, Apply, generic
class
GradTodo
(
Op
):
class
GradTodo
(
Op
):
__props__
=
()
def
make_node
(
self
,
x
):
def
make_node
(
self
,
x
):
return
Apply
(
self
,
[
x
],
[
x
.
type
()])
return
Apply
(
self
,
[
x
],
[
x
.
type
()])
...
@@ -40,22 +43,12 @@ class FFT(Op):
...
@@ -40,22 +43,12 @@ class FFT(Op):
half
=
False
half
=
False
"""Only return the first half (positive-valued) of the frequency components"""
"""Only return the first half (positive-valued) of the frequency components"""
__props__
=
(
"half"
,
"inverse"
)
def
__init__
(
self
,
half
=
False
,
inverse
=
False
):
def
__init__
(
self
,
half
=
False
,
inverse
=
False
):
self
.
half
=
half
self
.
half
=
half
self
.
inverse
=
inverse
self
.
inverse
=
inverse
def
__eq__
(
self
,
other
):
return
(
type
(
self
)
==
type
(
other
)
and
self
.
half
==
other
.
half
and
self
.
inverse
==
other
.
inverse
)
def
__hash__
(
self
):
return
hash
(
type
(
self
))
^
hash
(
self
.
half
)
^
9828743
^
(
self
.
inverse
)
def
__ne__
(
self
,
other
):
return
not
(
self
==
other
)
def
make_node
(
self
,
frames
,
n
,
axis
):
def
make_node
(
self
,
frames
,
n
,
axis
):
""" compute an n-point fft of frames along given axis """
""" compute an n-point fft of frames along given axis """
_frames
=
tensor
.
as_tensor
(
frames
,
ndim
=
2
)
_frames
=
tensor
.
as_tensor
(
frames
,
ndim
=
2
)
...
...
theano/sandbox/multinomial.py
浏览文件 @
c5e8a93c
...
@@ -14,15 +14,11 @@ if cuda_available:
...
@@ -14,15 +14,11 @@ if cuda_available:
class
MultinomialFromUniform
(
Op
):
class
MultinomialFromUniform
(
Op
):
'''Converts samples from a uniform into sample from a multinomial.'''
'''Converts samples from a uniform into sample from a multinomial.'''
__props__
=
(
"odtype"
,)
def
__init__
(
self
,
odtype
):
def
__init__
(
self
,
odtype
):
self
.
odtype
=
odtype
self
.
odtype
=
odtype
def
__eq__
(
self
,
other
):
return
type
(
self
)
==
type
(
other
)
and
self
.
odtype
==
other
.
odtype
def
__hash__
(
self
):
return
hash
((
type
(
self
),
self
.
odtype
))
def
__str__
(
self
):
def
__str__
(
self
):
return
'
%
s{
%
s}'
%
(
self
.
__class__
.
__name__
,
self
.
odtype
)
return
'
%
s{
%
s}'
%
(
self
.
__class__
.
__name__
,
self
.
odtype
)
...
...
theano/sandbox/neighbourhoods.py
浏览文件 @
c5e8a93c
...
@@ -16,6 +16,10 @@ from theano import gof, Op
...
@@ -16,6 +16,10 @@ from theano import gof, Op
class
NeighbourhoodsFromImages
(
Op
):
class
NeighbourhoodsFromImages
(
Op
):
__props__
=
(
"n_dims_before"
,
"dims_neighbourhoods"
,
"strides"
,
"ignore_border"
,
"inverse"
)
def
__init__
(
self
,
n_dims_before
,
dims_neighbourhoods
,
def
__init__
(
self
,
n_dims_before
,
dims_neighbourhoods
,
strides
=
None
,
ignore_border
=
False
,
inverse
=
False
):
strides
=
None
,
ignore_border
=
False
,
inverse
=
False
):
"""
"""
...
@@ -84,20 +88,6 @@ class NeighbourhoodsFromImages(Op):
...
@@ -84,20 +88,6 @@ class NeighbourhoodsFromImages(Op):
self
.
code_string
,
self
.
code
=
self
.
make_py_code
()
self
.
code_string
,
self
.
code
=
self
.
make_py_code
()
def
__eq__
(
self
,
other
):
return
type
(
self
)
==
type
(
other
)
and
\
self
.
n_dims_before
==
other
.
n_dims_before
and
\
self
.
dims_neighbourhoods
==
other
.
dims_neighbourhoods
and
\
self
.
strides
==
other
.
strides
and
\
self
.
ignore_border
==
other
.
ignore_border
def
__hash__
(
self
):
return
hash
(
type
(
self
))
^
\
hash
(
self
.
n_dims_before
)
^
\
hash
(
self
.
dims_neighbourhoods
)
^
\
hash
(
self
.
strides
)
^
\
hash
(
self
.
ignore_border
)
def
__str__
(
self
):
def
__str__
(
self
):
return
'
%
s{
%
s,
%
s,
%
s,
%
s}'
%
(
self
.
__class__
.
__name__
,
return
'
%
s{
%
s,
%
s,
%
s,
%
s}'
%
(
self
.
__class__
.
__name__
,
self
.
n_dims_before
,
self
.
n_dims_before
,
...
...
theano/sandbox/rng_mrg.py
浏览文件 @
c5e8a93c
...
@@ -78,11 +78,7 @@ class DotModulo(Op):
...
@@ -78,11 +78,7 @@ class DotModulo(Op):
We do this 2 times on 2 triple inputs and concatenating the output
We do this 2 times on 2 triple inputs and concatenating the output
"""
"""
def
__eq__
(
self
,
other
):
__props__
=
()
return
type
(
self
)
==
type
(
other
)
def
__hash__
(
self
):
return
hash
(
type
(
self
))
def
make_node
(
self
,
A
,
s
,
m
,
A2
,
s2
,
m2
):
def
make_node
(
self
,
A
,
s
,
m
,
A2
,
s2
,
m2
):
return
Apply
(
self
,
[
A
,
s
,
m
,
A2
,
s2
,
m2
],
[
s
.
type
()])
return
Apply
(
self
,
[
A
,
s
,
m
,
A2
,
s2
,
m2
],
[
s
.
type
()])
...
@@ -286,6 +282,9 @@ def mrg_next_value(rstate, new_rstate):
...
@@ -286,6 +282,9 @@ def mrg_next_value(rstate, new_rstate):
class
mrg_uniform_base
(
Op
):
class
mrg_uniform_base
(
Op
):
__props__
=
(
"output_type"
,
"inplace"
)
def
__init__
(
self
,
output_type
,
inplace
=
False
):
def
__init__
(
self
,
output_type
,
inplace
=
False
):
Op
.
__init__
(
self
)
Op
.
__init__
(
self
)
self
.
output_type
=
output_type
self
.
output_type
=
output_type
...
@@ -294,14 +293,6 @@ class mrg_uniform_base(Op):
...
@@ -294,14 +293,6 @@ class mrg_uniform_base(Op):
self
.
destroy_map
=
{
0
:
[
0
]}
self
.
destroy_map
=
{
0
:
[
0
]}
self
.
warned_numpy_version
=
False
self
.
warned_numpy_version
=
False
def
__eq__
(
self
,
other
):
return
(
type
(
self
)
==
type
(
other
)
and
self
.
output_type
==
other
.
output_type
and
self
.
inplace
==
other
.
inplace
)
def
__hash__
(
self
):
return
hash
(
type
(
self
))
^
hash
(
self
.
output_type
)
^
hash
(
self
.
inplace
)
def
__str__
(
self
):
def
__str__
(
self
):
if
self
.
inplace
:
if
self
.
inplace
:
s
=
"inplace"
s
=
"inplace"
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论