Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
0d423a9d
提交
0d423a9d
authored
7月 07, 2017
作者:
Frédéric Bastien
提交者:
GitHub
7月 07, 2017
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #6120 from lamblin/better_travis
Various improvements for Travis
上级
568af179
1d38dfbc
隐藏空白字符变更
内嵌
并排
正在显示
8 个修改的文件
包含
87 行增加
和
56 行删除
+87
-56
.travis.yml
.travis.yml
+55
-26
travis_install.sh
.travis/travis_install.sh
+2
-2
gradient.py
theano/gradient.py
+6
-3
test_corr3d.py
theano/tensor/nnet/tests/test_corr3d.py
+19
-19
test_basic.py
theano/tensor/tests/test_basic.py
+3
-3
test_extra_ops.py
theano/tensor/tests/test_extra_ops.py
+0
-1
test_flake8.py
theano/tests/test_flake8.py
+0
-1
test_rop.py
theano/tests/test_rop.py
+2
-1
没有找到文件。
.travis.yml
浏览文件 @
0d423a9d
...
...
@@ -10,9 +10,7 @@ cache:
language
:
python
python
:
-
"
2.7"
-
"
3.4"
# For now, Python versions have to be listed in the "jobs" matrix
# NB:
# In before_install and install sections below,
...
...
@@ -42,33 +40,64 @@ install:
# nose-exclude plugin allow us to tell nosetests to exclude folder with --exclude-dir=path/to/directory.
-
pip install nose-exclude nose-timer
# command to run tests
env
:
-
PART="theano/tests/test_flake8.py" DOC=1
-
PART="-e test_flake8.py theano/compat theano/compile theano/d3viz theano/gof theano/misc theano/sandbox theano/scalar theano/scan_module theano/sparse theano/tests theano/typed_list"
-
PART="theano/tensor -e test_basic.py --exclude-dir=theano/tensor/nnet"
-
PART="theano/tensor/tests/test_basic.py"
-
PART="theano/tensor/nnet -e test_abstract_conv.py"
-
PART="theano/tensor/nnet/tests/test_abstract_conv.py"
matrix
:
fast_finish
:
true
jobs
:
include
:
-
python
:
"
3.4"
env
:
PART="--exclude-dir=theano/tensor -e test_flake8.py ." THEANO_FLAGS="mode=FAST_COMPILE"
-
python
:
"
3.4"
env
:
PART="theano/tensor --exclude-dir=theano/tensor/nnet" THEANO_FLAGS="mode=FAST_COMPILE"
-
python
:
"
3.4"
env
:
PART="theano/tensor/nnet" THEANO_FLAGS="mode=FAST_COMPILE"
-
python
:
"
2.7"
env
:
PART="--exclude-dir=theano/tensor -e test_flake8.py ." THEANO_FLAGS="mode=FAST_COMPILE,floatX=float32"
-
python
:
"
2.7"
env
:
PART="theano/tensor --exclude-dir=theano/tensor/nnet" THEANO_FLAGS="mode=FAST_COMPILE,floatX=float32"
-
python
:
"
2.7"
env
:
PART="theano/tensor/nnet" THEANO_FLAGS="mode=FAST_COMPILE,floatX=float32"
# define prototype for doctest
-
&doctest
stage
:
doc
python
:
"
2.7"
env
:
DOC=1 PART="theano/tests/test_flake8.py"
# re-use prototype, changing the Python version
-
<<
:
*doctest
python
:
"
3.4"
-
&normaltest
stage
:
test
python
:
"
2.7"
env
:
PART="theano/compat theano/compile theano/d3viz theano/gof theano/misc theano/sandbox theano/scalar theano/scan_module theano/sparse theano/tests -e test_flake8.py theano/typed_list"
-
<<
:
*normaltest
python
:
"
3.4"
-
<<
:
*normaltest
env
:
PART="theano/tensor -e test_basic.py --exclude-dir=theano/tensor/nnet"
-
<<
:
*normaltest
python
:
"
3.4"
env
:
PART="theano/tensor -e test_basic.py --exclude-dir=theano/tensor/nnet"
-
<<
:
*normaltest
env
:
PART="theano/tensor/tests/test_basic.py"
-
<<
:
*normaltest
python
:
"
3.4"
env
:
PART="theano/tensor/tests/test_basic.py"
-
<<
:
*normaltest
env
:
PART="theano/tensor/nnet -e test_abstract_conv.py"
-
<<
:
*normaltest
python
:
"
3.4"
env
:
PART="theano/tensor/nnet -e test_abstract_conv.py"
-
<<
:
*normaltest
env
:
PART="theano/tensor/nnet/tests/test_abstract_conv.py"
-
<<
:
*normaltest
python
:
"
3.4"
env
:
PART="theano/tensor/nnet/tests/test_abstract_conv.py"
-
<<
:
*normaltest
env
:
FAST_COMPILE=1 FLOAT32=1 PART="--exclude-dir=theano/tensor -e test_flake8.py ."
-
<<
:
*normaltest
python
:
"
3.4"
env
:
FAST_COMPILE=1 PART="--exclude-dir=theano/tensor -e test_flake8.py ."
-
<<
:
*normaltest
env
:
FAST_COMPILE=1 FLOAT32=1 PART="theano/tensor --exclude-dir=theano/tensor/nnet"
-
<<
:
*normaltest
python
:
"
3.4"
env
:
FAST_COMPILE=1 PART="theano/tensor --exclude-dir=theano/tensor/nnet"
-
<<
:
*normaltest
env
:
FAST_COMPILE=1 FLOAT32=1 PART="theano/tensor/nnet"
-
<<
:
*normaltest
python
:
"
3.4"
env
:
FAST_COMPILE=1 PART="theano/tensor/nnet"
script
:
-
if [[ $FAST_COMPILE == "1" ]]; then export THEANO_FLAGS=$THEANO_FLAGS,mode=FAST_COMPILE; fi
-
if [[ $FLOAT32 == "1" ]]; then export THEANO_FLAGS=$THEANO_FLAGS,floatX=float32; fi
-
export THEANO_FLAGS=$THEANO_FLAGS,warn.ignore_bug_before=all,on_opt_error=raise,on_shape_error=raise,gcc.cxxflags=-pipe
-
export MKL_NUM_THREADS=1
-
export OMP_NUM_THREADS=1
-
python --version
-
uname -a
-
free -m
...
...
.travis/travis_install.sh
浏览文件 @
0d423a9d
...
...
@@ -9,6 +9,6 @@ else
fi
source
activate pyenv
if
[[
$TRAVIS_PYTHON_VERSION
==
'2.7'
]]
;
then
conda
install
--yes
-q
mkl
numpy
=
1.9.1
scipy
=
0.14.0
nose
=
1.3.0 pip
flake8
=
2.3
six
=
1.9.0
pep8
=
1.6.2
pyflakes
=
0.8.1
sphinx
=
1.5.1 mkl-service
libgfortran
=
1
;
fi
if
[[
$TRAVIS_PYTHON_VERSION
==
'3.4'
]]
;
then
conda
install
--yes
-q
mkl
numpy
=
1.9.1
scipy
=
0.14.0
nose
=
1.3.4 pip
flake8
=
2.3
six
=
1.9.0
pep8
=
1.6.2
pyflakes
=
0.8.1
sphinx
=
1.5.1 mkl-service
libgfortran
=
1
;
fi
if
[[
$TRAVIS_PYTHON_VERSION
==
'2.7'
]]
;
then
conda
install
--yes
-q
mkl
numpy
=
1.9.1
scipy
=
0.14.0
nose
=
1.3.0 pip
flake8
=
2.3
six
=
1.9.0
pep8
=
1.6.2
pyflakes
=
0.8.1
sphinx
=
1.5.1 mkl-service
libgfortran
=
1
graphviz
;
fi
if
[[
$TRAVIS_PYTHON_VERSION
==
'3.4'
]]
;
then
conda
install
--yes
-q
mkl
numpy
=
1.9.1
scipy
=
0.14.0
nose
=
1.3.4 pip
flake8
=
2.3
six
=
1.9.0
pep8
=
1.6.2
pyflakes
=
0.8.1
sphinx
=
1.5.1 mkl-service
libgfortran
=
1
graphviz
;
fi
source
deactivate
theano/gradient.py
浏览文件 @
0d423a9d
...
...
@@ -17,7 +17,7 @@ from theano.compat import izip
from
six.moves
import
xrange
,
reduce
from
theano.gof.null_type
import
NullType
,
null_type
from
theano.gof.op
import
get_debug_values
from
theano.compile
import
ViewOp
,
FAST_RUN
,
DebugMode
from
theano.compile
import
ViewOp
,
FAST_RUN
,
DebugMode
,
get_mode
__authors__
=
"James Bergstra, Razvan Pascanu, Arnaud Bergeron, Ian Goodfellow"
__copyright__
=
"(c) 2011, Universite de Montreal"
...
...
@@ -1551,7 +1551,10 @@ class numeric_grad(object):
return
(
max_arg
,
max_pos
,
abs_errs
[
max_arg
],
rel_errs
[
max_arg
])
def
mode_not_debug
(
mode
):
def
mode_not_slow
(
mode
):
if
mode
==
'FAST_COMPILE'
:
return
FAST_RUN
mode
=
get_mode
(
mode
)
if
isinstance
(
mode
,
DebugMode
):
opt
=
mode
.
optimizer
return
FAST_RUN
.
clone
(
optimizer
=
opt
)
...
...
@@ -1686,7 +1689,7 @@ def verify_grad(fun, pt, n_tests=2, rng=None, eps=None,
cost
=
theano
.
tensor
.
sum
(
t_r
*
o_output
)
if
no_debug_ref
:
mode_for_cost
=
mode_not_
debug
(
mode
)
mode_for_cost
=
mode_not_
slow
(
mode
)
else
:
mode_for_cost
=
mode
...
...
theano/tensor/nnet/tests/test_corr3d.py
浏览文件 @
0d423a9d
...
...
@@ -199,25 +199,25 @@ class TestCorr3D(utt.InferShapeTester):
self
.
validate
((
1
,
1
,
6
,
6
,
6
),
(
1
,
1
,
3
,
3
,
3
),
1
,
subsample
=
(
3
,
3
,
3
))
def
test_filter_dilation
(
self
):
# Tests correlation where filter dilation != (1,1,1)
self
.
validate
((
3
,
2
,
7
,
5
,
5
),
(
2
,
2
,
2
,
3
,
3
),
'valid'
,
filter_dilation
=
(
2
,
2
,
2
))
self
.
validate
((
3
,
2
,
14
,
10
,
10
),
(
2
,
2
,
2
,
3
,
3
),
'valid'
,
filter_dilation
=
(
3
,
1
,
1
))
self
.
validate
((
1
,
1
,
14
,
14
,
14
),
(
1
,
1
,
3
,
3
,
3
),
'valid'
,
filter_dilation
=
(
2
,
3
,
3
))
self
.
validate
((
3
,
2
,
7
,
5
,
5
),
(
2
,
2
,
2
,
3
,
3
),
'full'
,
filter_dilation
=
(
2
,
2
,
2
))
self
.
validate
((
3
,
2
,
7
,
5
,
5
),
(
2
,
2
,
2
,
3
,
3
),
'full'
,
filter_dilation
=
(
3
,
1
,
1
))
self
.
validate
((
1
,
1
,
6
,
6
,
6
),
(
1
,
1
,
3
,
3
,
3
),
'full'
,
filter_dilation
=
(
2
,
3
,
3
))
self
.
validate
((
3
,
2
,
7
,
5
,
5
),
(
2
,
2
,
2
,
3
,
3
),
'half'
,
filter_dilation
=
(
2
,
2
,
2
))
self
.
validate
((
3
,
2
,
7
,
5
,
5
),
(
2
,
2
,
2
,
3
,
3
),
'half'
,
filter_dilation
=
(
3
,
1
,
1
))
self
.
validate
((
1
,
1
,
6
,
6
,
6
),
(
1
,
1
,
3
,
3
,
3
),
'half'
,
filter_dilation
=
(
2
,
3
,
3
))
self
.
validate
((
3
,
2
,
7
,
5
,
5
),
(
2
,
2
,
2
,
3
,
3
),
(
1
,
1
,
1
),
filter_dilation
=
(
2
,
2
,
2
)
)
self
.
validate
((
3
,
2
,
7
,
5
,
5
),
(
2
,
2
,
2
,
3
,
3
),
(
2
,
1
,
1
),
filter_dilation
=
(
2
,
1
,
1
))
self
.
validate
(
(
1
,
1
,
6
,
6
,
6
),
(
1
,
1
,
3
,
3
,
3
),
(
1
,
2
,
1
),
filter_dilation
=
(
1
,
2
,
1
)
)
self
.
validate
((
1
,
1
,
6
,
6
,
6
),
(
1
,
1
,
3
,
3
,
3
),
(
1
,
1
,
2
),
filter_dilation
=
(
1
,
1
,
2
))
# Tests correlation where filter dilation != (1,1,1)
@parameterized.expand
([
((
3
,
2
,
7
,
5
,
5
),
(
2
,
2
,
2
,
3
,
3
),
'valid'
,
(
2
,
2
,
2
)),
((
3
,
2
,
14
,
10
,
10
),
(
2
,
2
,
2
,
3
,
3
),
'valid'
,
(
3
,
1
,
1
)),
((
1
,
1
,
14
,
14
,
14
),
(
1
,
1
,
3
,
3
,
3
),
'valid'
,
(
2
,
3
,
3
)),
((
3
,
2
,
7
,
5
,
5
),
(
2
,
2
,
2
,
3
,
3
),
'full'
,
(
2
,
2
,
2
)),
((
3
,
2
,
7
,
5
,
5
),
(
2
,
2
,
2
,
3
,
3
),
'full'
,
(
3
,
1
,
1
)),
((
1
,
1
,
6
,
6
,
6
),
(
1
,
1
,
3
,
3
,
3
),
'full'
,
(
2
,
3
,
3
)),
((
3
,
2
,
7
,
5
,
5
),
(
2
,
2
,
2
,
3
,
3
),
'half'
,
(
2
,
2
,
2
)),
((
3
,
2
,
7
,
5
,
5
),
(
2
,
2
,
2
,
3
,
3
),
'half'
,
(
3
,
1
,
1
)),
((
1
,
1
,
6
,
6
,
6
),
(
1
,
1
,
3
,
3
,
3
),
'half'
,
(
2
,
3
,
3
)),
((
3
,
2
,
7
,
5
,
5
),
(
2
,
2
,
2
,
3
,
3
),
(
1
,
1
,
1
),
(
2
,
2
,
2
)),
((
3
,
2
,
7
,
5
,
5
),
(
2
,
2
,
2
,
3
,
3
),
(
2
,
1
,
1
),
(
2
,
1
,
1
)),
((
1
,
1
,
6
,
6
,
6
),
(
1
,
1
,
3
,
3
,
3
),
(
1
,
2
,
1
),
(
1
,
2
,
1
)),
((
1
,
1
,
6
,
6
,
6
),
(
1
,
1
,
3
,
3
,
3
),
(
1
,
1
,
2
),
(
1
,
1
,
2
))]
)
def
test_filter_dilation
(
self
,
image_shape
,
filter_shape
,
border_mode
,
filter_dilation
):
self
.
validate
(
image_shape
,
filter_shape
,
border_mode
,
filter_dilation
=
filter_dilation
)
def
test_filter_dilation_subsample
(
self
):
self
.
validate
((
1
,
1
,
6
,
6
,
6
),
(
1
,
1
,
3
,
3
,
3
),
1
,
subsample
=
(
3
,
3
,
3
),
filter_dilation
=
(
2
,
2
,
2
))
@parameterized.expand
([(
'valid'
,),
(
'full'
,),
(
'half'
,),
((
1
,
1
,
1
),),
...
...
theano/tensor/tests/test_basic.py
浏览文件 @
0d423a9d
...
...
@@ -2175,9 +2175,9 @@ BatchedDotTester = makeTester(
correct7
=
(
rand
(
3
,
5
),
rand
(
3
,
5
)),
correct8
=
(
rand
(
3
),
rand
(
3
)),
correct9
=
(
rand
(
3
,
5
,
7
,
11
),
rand
(
3
)),
correct10
=
(
rand
(
3
,
7
,
11
,
5
),
rand
(
3
,
5
)),
correct11
=
(
rand
(
3
,
7
,
11
,
5
),
rand
(
3
,
5
,
13
)),
correct12
=
(
rand
(
3
,
7
,
11
,
5
),
rand
(
3
,
13
,
5
,
17
)),
correct10
=
(
rand
(
3
,
2
,
6
,
5
),
rand
(
3
,
5
)),
correct11
=
(
rand
(
3
,
2
,
6
,
5
),
rand
(
3
,
5
,
7
)),
correct12
=
(
rand
(
3
,
2
,
6
,
5
),
rand
(
3
,
7
,
5
,
8
)),
mixed1
=
(
rand
(
3
,
5
)
.
astype
(
'float32'
),
rand
(
3
,
5
,
7
)),
mixed2
=
(
rand
(
3
,
5
)
.
astype
(
'float64'
),
...
...
theano/tensor/tests/test_extra_ops.py
浏览文件 @
0d423a9d
from
__future__
import
absolute_import
,
print_function
,
division
from
functools
import
partial
import
numpy
as
np
...
...
theano/tests/test_flake8.py
浏览文件 @
0d423a9d
...
...
@@ -62,7 +62,6 @@ whitelist_flake8 = [
"tensor/tests/test_sort.py"
,
"tensor/tests/test_raw_random.py"
,
"tensor/tests/test_xlogx.py"
,
"tensor/tests/test_extra_ops.py"
,
"tensor/tests/test_slinalg.py"
,
"tensor/tests/test_blas_c.py"
,
"tensor/tests/test_blas_scipy.py"
,
...
...
theano/tests/test_rop.py
浏览文件 @
0d423a9d
...
...
@@ -292,7 +292,8 @@ class test_RopLop(RopLop_checker):
sy
,
_
=
theano
.
scan
(
lambda
i
,
y
,
x
,
v
:
(
tensor
.
grad
(
y
[
i
],
x
)
*
v
)
.
sum
(),
sequences
=
tensor
.
arange
(
a_pooled
.
shape
[
0
]),
non_sequences
=
[
a_pooled
,
x
,
ex
])
non_sequences
=
[
a_pooled
,
x
,
ex
],
mode
=
mode
)
scan_f
=
function
([],
sy
,
on_unused_input
=
'ignore'
,
mode
=
mode
)
v1
=
rop_f
()
v2
=
scan_f
()
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论