Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
7efe043e
提交
7efe043e
authored
3月 12, 2015
作者:
bbabeshkin
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'upstream/master'
上级
54b461ff
4b27770c
隐藏空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
27 行增加
和
22 行删除
+27
-22
.travis.yml
.travis.yml
+1
-3
install.txt
doc/install.txt
+6
-8
setup.py
setup.py
+2
-3
basic_ops.py
theano/sandbox/cuda/basic_ops.py
+3
-0
dnn.py
theano/sandbox/cuda/dnn.py
+13
-6
opt.py
theano/sandbox/cuda/opt.py
+1
-1
test_dnn.py
theano/sandbox/cuda/tests/test_dnn.py
+1
-1
没有找到文件。
.travis.yml
浏览文件 @
7efe043e
...
@@ -15,9 +15,7 @@ before_install:
...
@@ -15,9 +15,7 @@ before_install:
-
conda update --yes conda
-
conda update --yes conda
install
:
install
:
# We support scipy 0.7.2, but it is not available on conda.
-
if [[ $TRAVIS_PYTHON_VERSION == '2.6' ]]; then conda create --yes -q -n pyenv mkl python=2.6 numpy=1.6.2 scipy=0.11 nose=1.1 pyparsing=1.5 pip; fi
# So we test with 0.11. Our internal buildbot have 0.7.2.
-
if [[ $TRAVIS_PYTHON_VERSION == '2.6' ]]; then conda create --yes -q -n pyenv mkl python=2.6 numpy=1.6 scipy=0.11 nose=1.1 pyparsing=1.5 pip; fi
-
if [[ $TRAVIS_PYTHON_VERSION == '3.3' ]]; then conda create --yes -q -n pyenv mkl python=3.3 numpy=1.9.1 scipy=0.14.0 nose=1.3.4 pip; fi
-
if [[ $TRAVIS_PYTHON_VERSION == '3.3' ]]; then conda create --yes -q -n pyenv mkl python=3.3 numpy=1.9.1 scipy=0.14.0 nose=1.3.4 pip; fi
-
source activate pyenv
-
source activate pyenv
-
if [[ $TRAVIS_PYTHON_VERSION == '2.6' ]]; then pip install pydot; fi
-
if [[ $TRAVIS_PYTHON_VERSION == '2.6' ]]; then pip install pydot; fi
...
...
doc/install.txt
浏览文件 @
7efe043e
...
@@ -23,7 +23,8 @@ instructions below for detailed installation steps):
...
@@ -23,7 +23,8 @@ instructions below for detailed installation steps):
Python_ >= 2.6
Python_ >= 2.6
The development package (``python-dev`` or ``python-devel``
The development package (``python-dev`` or ``python-devel``
on most Linux distributions) is recommended (see just below).
on most Linux distributions) is recommended (see just below).
Python 2.4 was supported up to and including the release 0.6.
Python 2.4 was supported up to and including the release 0.6.
Python 3 is supported via 2to3 only, starting from 3.3.
``g++``, ``python-dev``
``g++``, ``python-dev``
Not technically required but *highly* recommended, in order to compile
Not technically required but *highly* recommended, in order to compile
...
@@ -32,16 +33,13 @@ instructions below for detailed installation steps):
...
@@ -32,16 +33,13 @@ instructions below for detailed installation steps):
g++ >= 4.2 (for openmp that is currently always used)
g++ >= 4.2 (for openmp that is currently always used)
more recent version recommended!
more recent version recommended!
`NumPy <http://numpy.scipy.org/>`_ >= 1.
5.0
`NumPy <http://numpy.scipy.org/>`_ >= 1.
6.2
Earlier versions could work, but we don't test it.
Earlier versions could work, but we don't test it.
`SciPy <http://scipy.org>`_
`SciPy <http://scipy.org>`_
>= 0.11
Only currently required for sparse matrix and special functions
Only currently required for sparse matrix and special functions
support, but *highly* recommended. We recommend SciPy
support, but *highly* recommended. SciPy >=0.8 could work,
>=0.8 if you are using sparse matrices, because ``scipy.sparse``
but earlier versions have known bugs with sparse matrices.
is buggy in 0.6 (the ``scipy.csc_matrix`` version of ``dot()`` has a
bug with singleton dimensions, there may be more bugs) and we do not
run tests with 0.7.
A `BLAS`_ installation (with Level 3 functionality)
A `BLAS`_ installation (with Level 3 functionality)
Including the development headers (``-dev``, ``-devel``, depending on
Including the development headers (``-dev``, ``-devel``, depending on
...
...
setup.py
浏览文件 @
7efe043e
...
@@ -43,12 +43,11 @@ Operating System :: POSIX
...
@@ -43,12 +43,11 @@ Operating System :: POSIX
Operating System :: Unix
Operating System :: Unix
Operating System :: MacOS
Operating System :: MacOS
Programming Language :: Python :: 2
Programming Language :: Python :: 2
Programming Language :: Python :: 2.4
Programming Language :: Python :: 2.5
Programming Language :: Python :: 2.6
Programming Language :: Python :: 2.6
Programming Language :: Python :: 2.7
Programming Language :: Python :: 2.7
Programming Language :: Python :: 3
Programming Language :: Python :: 3
Programming Language :: Python :: 3.3
Programming Language :: Python :: 3.3
Programming Language :: Python :: 3.4
"""
"""
NAME
=
'Theano'
NAME
=
'Theano'
MAINTAINER
=
"LISA laboratory, University of Montreal"
MAINTAINER
=
"LISA laboratory, University of Montreal"
...
@@ -175,7 +174,7 @@ def do_setup():
...
@@ -175,7 +174,7 @@ def do_setup():
license
=
LICENSE
,
license
=
LICENSE
,
platforms
=
PLATFORMS
,
platforms
=
PLATFORMS
,
packages
=
find_packages
(),
packages
=
find_packages
(),
install_requires
=
[
'numpy>=1.
5.0'
,
'scipy>=0.7.2
'
],
install_requires
=
[
'numpy>=1.
6.2'
,
'scipy>=0.11
'
],
package_data
=
{
package_data
=
{
''
:
[
'*.txt'
,
'*.rst'
,
'*.cu'
,
'*.cuh'
,
'*.c'
,
'*.sh'
,
'*.pkl'
,
''
:
[
'*.txt'
,
'*.rst'
,
'*.cu'
,
'*.cuh'
,
'*.c'
,
'*.sh'
,
'*.pkl'
,
'*.h'
,
'ChangeLog'
],
'*.h'
,
'ChangeLog'
],
...
...
theano/sandbox/cuda/basic_ops.py
浏览文件 @
7efe043e
...
@@ -3434,6 +3434,9 @@ class CopyOnNegativeStrides(GpuOp):
...
@@ -3434,6 +3434,9 @@ class CopyOnNegativeStrides(GpuOp):
i
=
i
.
copy
()
i
=
i
.
copy
()
out
[
0
][
0
]
=
i
out
[
0
][
0
]
=
i
def
infer_shape
(
self
,
node
,
xshp
):
return
xshp
def
c_code
(
self
,
node
,
name
,
inp
,
out
,
sub
):
def
c_code
(
self
,
node
,
name
,
inp
,
out
,
sub
):
input
,
=
inp
input
,
=
inp
z
,
=
out
z
,
=
out
...
...
theano/sandbox/cuda/dnn.py
浏览文件 @
7efe043e
...
@@ -649,12 +649,19 @@ def dnn_conv(img, kerns, border_mode='valid', subsample=(1, 1),
...
@@ -649,12 +649,19 @@ def dnn_conv(img, kerns, border_mode='valid', subsample=(1, 1),
capability of 3.0 or higer. This means that older GPU will not
capability of 3.0 or higer. This means that older GPU will not
work with this Op.
work with this Op.
"""
"""
def
contig_version
(
var
):
if
version
()
==
-
1
:
var
=
gpu_contiguous
(
var
)
else
:
var
=
cp_on_negative_strides
(
var
)
return
var
fgraph
=
getattr
(
img
,
'fgraph'
,
None
)
or
getattr
(
kerns
,
'fgraph'
,
None
)
fgraph
=
getattr
(
img
,
'fgraph'
,
None
)
or
getattr
(
kerns
,
'fgraph'
,
None
)
if
(
border_mode
==
'valid'
and
subsample
==
(
1
,
1
)
and
if
(
border_mode
==
'valid'
and
subsample
==
(
1
,
1
)
and
direction_hint
==
'bprop weights'
):
direction_hint
==
'bprop weights'
):
# Special case: We are asked to use GpuDnnConvGradW. We need to set
# Special case: We are asked to use GpuDnnConvGradW. We need to set
# up a suitable 'fake' convolution to compute the gradient for.
# up a suitable 'fake' convolution to compute the gradient for.
img
=
c
p_on_negative_strides
(
img
.
dimshuffle
(
1
,
0
,
2
,
3
))
img
=
c
ontig_version
(
img
.
dimshuffle
(
1
,
0
,
2
,
3
))
if
conv_mode
==
'conv'
:
if
conv_mode
==
'conv'
:
# We need to flip manually. These 'kerns' are not the kernels
# We need to flip manually. These 'kerns' are not the kernels
# that would be flipped by conv_mode='conv' in GpuDnnConvGradW.
# that would be flipped by conv_mode='conv' in GpuDnnConvGradW.
...
@@ -674,7 +681,7 @@ def dnn_conv(img, kerns, border_mode='valid', subsample=(1, 1),
...
@@ -674,7 +681,7 @@ def dnn_conv(img, kerns, border_mode='valid', subsample=(1, 1),
# Special case: We can be faster by using GpuDnnConvGradI to compute
# Special case: We can be faster by using GpuDnnConvGradI to compute
# the full convolution as the backward pass of a valid convolution.
# the full convolution as the backward pass of a valid convolution.
# We just need to set up a suitable 'fake' valid convolution.
# We just need to set up a suitable 'fake' valid convolution.
img
=
cp_on_negative_strides
(
img
)
img
=
gpu_contiguous
(
img
)
# cudnn v1 and v2 rc3 need contiguous data
kerns
=
gpu_contiguous
(
kerns
.
dimshuffle
(
1
,
0
,
2
,
3
))
kerns
=
gpu_contiguous
(
kerns
.
dimshuffle
(
1
,
0
,
2
,
3
))
conv_mode
=
'cross'
if
conv_mode
==
'conv'
else
'conv'
conv_mode
=
'cross'
if
conv_mode
==
'conv'
else
'conv'
shape2
=
shape_i
(
img
,
2
,
fgraph
)
+
shape_i
(
kerns
,
2
,
fgraph
)
-
1
shape2
=
shape_i
(
img
,
2
,
fgraph
)
+
shape_i
(
kerns
,
2
,
fgraph
)
-
1
...
@@ -686,9 +693,9 @@ def dnn_conv(img, kerns, border_mode='valid', subsample=(1, 1),
...
@@ -686,9 +693,9 @@ def dnn_conv(img, kerns, border_mode='valid', subsample=(1, 1),
return
GpuDnnConvGradI
()(
kerns
,
img
,
out
,
desc
)
return
GpuDnnConvGradI
()(
kerns
,
img
,
out
,
desc
)
# Standard case: We use GpuDnnConv with suitable padding.
# Standard case: We use GpuDnnConv with suitable padding.
# c
p_on_negative_strides
will return a gpu_contiguous copy
# c
ontig_version
will return a gpu_contiguous copy
# if the img contains negative strides
# if the img contains negative strides
img
=
c
p_on_negative_strides
(
img
)
img
=
c
ontig_version
(
img
)
kerns
=
gpu_contiguous
(
kerns
)
kerns
=
gpu_contiguous
(
kerns
)
desc
=
GpuDnnConvDesc
(
border_mode
=
border_mode
,
subsample
=
subsample
,
desc
=
GpuDnnConvDesc
(
border_mode
=
border_mode
,
subsample
=
subsample
,
conv_mode
=
conv_mode
)(
img
.
shape
,
kerns
.
shape
)
conv_mode
=
conv_mode
)(
img
.
shape
,
kerns
.
shape
)
...
@@ -746,7 +753,7 @@ class GpuDnnPoolDesc(GpuOp):
...
@@ -746,7 +753,7 @@ class GpuDnnPoolDesc(GpuOp):
self
.
stride
=
stride
self
.
stride
=
stride
assert
len
(
stride
)
==
2
assert
len
(
stride
)
==
2
self
.
pad
=
pad
self
.
pad
=
pad
if
(
pad
[
0
]
!=
0
or
pad
[
1
]
!=
0
)
and
version
()
<
20
:
if
(
pad
[
0
]
!=
0
or
pad
[
1
]
!=
0
)
and
version
()
==
-
1
:
raise
RuntimeError
(
"CuDNN pooling with padding requires CuDNN v2"
)
raise
RuntimeError
(
"CuDNN pooling with padding requires CuDNN v2"
)
def
__setstate__
(
self
,
d
):
def
__setstate__
(
self
,
d
):
...
@@ -755,7 +762,7 @@ class GpuDnnPoolDesc(GpuOp):
...
@@ -755,7 +762,7 @@ class GpuDnnPoolDesc(GpuOp):
self
.
pad
=
(
0
,
0
)
self
.
pad
=
(
0
,
0
)
def
make_node
(
self
):
def
make_node
(
self
):
if
self
.
pad
!=
(
0
,
0
)
and
version
()
<
20
:
if
self
.
pad
!=
(
0
,
0
)
and
version
()
==
-
1
:
raise
RuntimeError
(
"CuDNN pooling with padding requires CuDNN v2"
)
raise
RuntimeError
(
"CuDNN pooling with padding requires CuDNN v2"
)
return
Apply
(
self
,
[],
return
Apply
(
self
,
[],
...
...
theano/sandbox/cuda/opt.py
浏览文件 @
7efe043e
...
@@ -1763,7 +1763,7 @@ def get_device_type_sizes():
...
@@ -1763,7 +1763,7 @@ def get_device_type_sizes():
del
t
del
t
except
Exception
,
e
:
except
Exception
,
e
:
_logger
.
warning
((
"Optimization Warning: "
_logger
.
warning
((
"Optimization Warning: "
"Got the following error, but
we
can ignore it. "
"Got the following error, but
you
can ignore it. "
"This could cause less GpuElemwise fused together.
\n
"
"This could cause less GpuElemwise fused together.
\n
"
"
%
s"
)
%
e
)
"
%
s"
)
%
e
)
...
...
theano/sandbox/cuda/tests/test_dnn.py
浏览文件 @
7efe043e
...
@@ -70,7 +70,7 @@ def test_pooling():
...
@@ -70,7 +70,7 @@ def test_pooling():
x
=
T
.
ftensor4
()
x
=
T
.
ftensor4
()
for
func
,
pad
in
product
((
T
.
max
,
T
.
mean
),
for
func
,
pad
in
product
((
T
.
max
,
T
.
mean
),
((
0
,
0
),
(
1
,
0
),
(
1
,
0
),
(
2
,
3
),
(
3
,
2
))):
((
0
,
0
),
(
1
,
0
),
(
1
,
0
),
(
2
,
3
),
(
3
,
2
))):
if
pad
!=
(
0
,
0
)
and
cuda
.
dnn
.
version
()
<
20
:
if
pad
!=
(
0
,
0
)
and
cuda
.
dnn
.
version
()
==
-
1
:
continue
continue
if
pad
!=
(
0
,
0
)
and
func
is
T
.
mean
:
if
pad
!=
(
0
,
0
)
and
func
is
T
.
mean
:
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论