Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
a3870bb2
提交
a3870bb2
authored
12月 05, 2014
作者:
Frédéric Bastien
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #2322 from lamblin/travis_py3
Run part of travis on Python 3
上级
34a15a3f
16018ae7
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
45 行增加
和
34 行删除
+45
-34
.travis.yml
.travis.yml
+21
-10
test_mlp.py
theano/sandbox/cuda/tests/test_mlp.py
+3
-3
test_linalg.py
theano/sandbox/linalg/tests/test_linalg.py
+14
-14
scan_opt.py
theano/scan_module/scan_opt.py
+3
-3
test_scan_opt.py
theano/scan_module/tests/test_scan_opt.py
+4
-4
没有找到文件。
.travis.yml
浏览文件 @
a3870bb2
...
...
@@ -4,8 +4,6 @@
language
:
python
python
:
-
"
2.6"
# - "2.7"
# - "3.2"
# command to install dependencies
before_install
:
...
...
@@ -20,25 +18,38 @@ before_install:
install
:
# We support scipy 0.7.2, but it is not available on conda.
# So we test with 0.11. Our internal buildbot have 0.7.2.
-
conda create --yes -q -n py26 python=2.6 numpy=1.6 scipy=0.11 nose=1.1 pip
-
source activate py26
-
pip install pydot
-
if [[ $TRAVIS_PYTHON_VERSION == '2.6' ]]; then conda create --yes -q -n pyenv 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 python=3.3 numpy=1.9.1 scipy=0.14.0 nose=1.3.4 pip; fi
-
source activate pyenv
-
if [[ $TRAVIS_PYTHON_VERSION == '2.6' ]]; then pip install pydot; fi
-
pip install . --no-deps --use-mirrors
# command to run tests
env
:
-
PART="theano/scan_module/"
-
PART="theano/sandbox theano/sparse theano/scalar/ theano/tensor/nnet/"
-
PART="theano/tensor/tests/test_basic.py theano/tensor/signal/ theano/compile/ theano/gof/ theano/misc/ theano/tests/ theano/compat"
-
PART="-e test_basic.py theano/tensor/tests"
-
PART="scan_module"
-
PART="sandbox sparse scalar tensor/nnet"
-
PART="tensor/tests/test_basic.py tensor/signal compile gof misc tests compat"
-
PART="-e test_basic.py tensor/tests"
matrix
:
# Explicitly add one part to be run with Python 3, and a complete run in FAST_COMPILE
include
:
-
python
:
"
3.3"
env
:
PART="tensor/tests/test_basic.py tensor/signal compile gof misc tests compat"
-
python
:
"
2.6"
env
:
PART="." THEANO_FLAGS="mode=FAST_COMPILE"
script
:
-
export THEANO_FLAGS=blas.ldflags="-lblas -lgfortran",warn.ignore_bug_before=all,on_opt_error=raise,on_shape_error=raise
-
export THEANO_FLAGS=
$THEANO_FLAGS,
blas.ldflags="-lblas -lgfortran",warn.ignore_bug_before=all,on_opt_error=raise,on_shape_error=raise
-
python --version
-
uname -a
-
free -m
-
df -h
-
ulimit -a
# Move out of Theano so the import will use the installed version
-
cd ..
# Move to the path of the installed version
-
cd $(python -c 'import theano; import os; print(os.path.split(theano.__file__)[0])')
-
echo "$PART"
-
theano-nose -v $PART
-
theano-cache list
...
...
theano/sandbox/cuda/tests/test_mlp.py
浏览文件 @
a3870bb2
...
...
@@ -275,8 +275,8 @@ def run_conv_nnet2(use_gpu): # pretend we are training LeNet for MNIST
lr
=
tensor
.
fscalar
(
'lr'
)
conv_op
=
conv
.
ConvOp
(
shape_img
[
2
:],
shape_kern
[
2
:],
n_kern
,
n_batch
,
1
,
1
)
conv_op1
=
conv
.
ConvOp
((
n_kern
,
logical_hid_shape
[
0
]
/
2
,
logical_hid_shape
[
1
]
/
2
),
shape_kern1
[
2
:],
n_kern1
,
n_batch
,
1
,
1
)
conv_op1
=
conv
.
ConvOp
((
n_kern
,
logical_hid_shape
[
0
]
/
/
2
,
logical_hid_shape
[
1
]
/
/
2
),
shape_kern1
[
2
:],
n_kern1
,
n_batch
,
1
,
1
)
hid
=
tensor
.
tanh
(
conv_op
(
x
,
w0
)
+
b0
.
dimshuffle
((
0
,
'x'
,
'x'
)))
hid1
=
tensor
.
tanh
(
conv_op1
(
hid
[:,
:,
::
2
,
::
2
],
w1
)
+
b1
.
dimshuffle
((
...
...
@@ -366,7 +366,7 @@ def build_conv_nnet2_classif(use_gpu, isize, ksize, n_batch,
conv_op
=
conv
.
ConvOp
(
shape_img
[
2
:],
shape_kern
[
2
:],
n_kern
,
n_batch
,
1
,
1
,
verbose
=
verbose
,
version
=
version
)
conv_op1
=
conv
.
ConvOp
(
(
n_kern
,
logical_hid_shape
[
0
]
/
2
,
logical_hid_shape
[
1
]
/
2
),
(
n_kern
,
logical_hid_shape
[
0
]
/
/
2
,
logical_hid_shape
[
1
]
/
/
2
),
shape_kern1
[
2
:],
n_kern1
,
n_batch
,
1
,
1
,
verbose
=
verbose
,
version
=
version
)
ds_op
=
downsample
.
DownsampleFactorMax
((
2
,
2
),
ignore_border
=
False
)
...
...
theano/sandbox/linalg/tests/test_linalg.py
浏览文件 @
a3870bb2
...
...
@@ -147,11 +147,12 @@ def test_transinv_to_invtrans():
Y
=
tensor
.
nlinalg
.
matrix_inverse
(
X
)
Z
=
Y
.
transpose
()
f
=
theano
.
function
([
X
],
Z
)
for
node
in
f
.
maker
.
fgraph
.
toposort
():
if
isinstance
(
node
.
op
,
MatrixInverse
):
assert
isinstance
(
node
.
inputs
[
0
]
.
owner
.
op
,
DimShuffle
)
if
isinstance
(
node
.
op
,
DimShuffle
):
assert
node
.
inputs
[
0
]
.
name
==
'X'
if
config
.
mode
!=
'FAST_COMPILE'
:
for
node
in
f
.
maker
.
fgraph
.
toposort
():
if
isinstance
(
node
.
op
,
MatrixInverse
):
assert
isinstance
(
node
.
inputs
[
0
]
.
owner
.
op
,
DimShuffle
)
if
isinstance
(
node
.
op
,
DimShuffle
):
assert
node
.
inputs
[
0
]
.
name
==
'X'
def
test_tag_solve_triangular
():
...
...
@@ -164,13 +165,12 @@ def test_tag_solve_triangular():
b1
=
solve
(
L
,
x
)
b2
=
solve
(
U
,
x
)
f
=
theano
.
function
([
A
,
x
],
b1
)
for
node
in
f
.
maker
.
fgraph
.
toposort
():
if
isinstance
(
node
.
op
,
Solve
):
assert
node
.
op
.
A_structure
==
'lower_triangular'
if
config
.
mode
!=
'FAST_COMPILE'
:
for
node
in
f
.
maker
.
fgraph
.
toposort
():
if
isinstance
(
node
.
op
,
Solve
):
assert
node
.
op
.
A_structure
==
'lower_triangular'
f
=
theano
.
function
([
A
,
x
],
b2
)
for
node
in
f
.
maker
.
fgraph
.
toposort
():
if
isinstance
(
node
.
op
,
Solve
):
assert
node
.
op
.
A_structure
==
'upper_triangular'
if
config
.
mode
!=
'FAST_COMPILE'
:
for
node
in
f
.
maker
.
fgraph
.
toposort
():
if
isinstance
(
node
.
op
,
Solve
):
assert
node
.
op
.
A_structure
==
'upper_triangular'
theano/scan_module/scan_opt.py
浏览文件 @
a3870bb2
...
...
@@ -470,10 +470,10 @@ class PushOutSeqScan(gof.Optimizer):
outside_ins
=
replace_with_out
[
to_replace
.
index
(
x
)]
new_ord
=
(
0
,)
for
old_ord
in
nd
.
op
.
new_order
:
if
isinstance
(
old_ord
,
int
):
new_ord
+=
(
old_ord
+
1
,)
else
:
if
(
old_ord
==
'x'
):
new_ord
+=
(
old_ord
,)
else
:
new_ord
+=
(
old_ord
+
1
,)
new_outer
=
outside_ins
.
dimshuffle
(
new_ord
)
y
=
nd
.
outputs
[
0
]
y_place_holder
=
scan_utils
.
safe_new
(
y
,
'_replace'
)
...
...
theano/scan_module/tests/test_scan_opt.py
浏览文件 @
a3870bb2
...
...
@@ -202,11 +202,11 @@ class TestPushOutScanOutputDot(object):
# Compile the function twice, once with the optimization and once
# without
f_opt
=
theano
.
function
([
a
,
b
],
outputs
)
opt_mode
=
mode
.
including
(
"scan"
)
f_opt
=
theano
.
function
([
a
,
b
],
outputs
,
mode
=
opt_mode
)
default_mode
=
theano
.
compile
.
get_default_mode
()
default_mode
.
excluding
(
"scanOp_pushout_output"
)
f_no_opt
=
theano
.
function
([
a
,
b
],
outputs
,
mode
=
default_mode
)
no_opt_mode
=
mode
.
excluding
(
"scanOp_pushout_output"
)
f_no_opt
=
theano
.
function
([
a
,
b
],
outputs
,
mode
=
no_opt_mode
)
# Ensure that the optimization was performed correctly in f_opt
# The inner function of scan should have only one output and it should
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论