Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
5237b952
提交
5237b952
authored
1月 08, 2013
作者:
lamblin
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #1152 from nouiz/doc_sphinx_warn
A few small things.
上级
55f6a181
71230606
显示空白字符变更
内嵌
并排
正在显示
11 个修改的文件
包含
71 行增加
和
42 行删除
+71
-42
index.txt
doc/index.txt
+1
-1
install.txt
doc/install.txt
+8
-0
basic.txt
doc/library/tensor/basic.txt
+1
-0
debug_faq.txt
doc/tutorial/debug_faq.txt
+2
-2
examples.txt
doc/tutorial/examples.txt
+3
-3
gradient.py
theano/gradient.py
+3
-3
check_blas.py
theano/misc/check_blas.py
+3
-2
basic_ops.py
theano/sandbox/cuda/basic_ops.py
+5
-4
basic.py
theano/tensor/basic.py
+5
-4
test_basic.py
theano/tensor/tests/test_basic.py
+4
-2
run_tests_in_batch.py
theano/tests/run_tests_in_batch.py
+36
-21
没有找到文件。
doc/index.txt
浏览文件 @
5237b952
...
...
@@ -135,7 +135,7 @@ Community
* We use `Github tickets <http://github.com/Theano/Theano/issues>`__ to keep track of issues
(however, some old tickets can still be found on
`
`
Assembla <http://www.assembla.com/spaces/theano/tickets>`__).
`Assembla <http://www.assembla.com/spaces/theano/tickets>`__).
* Come visit us in Montreal! Most developers are students in the LISA_ group at the `University of Montreal`_.
...
...
doc/install.txt
浏览文件 @
5237b952
...
...
@@ -652,6 +652,14 @@ Theano dependencies is easy, but be aware that it will take a long time
$ python -c "import theano; theano.test()"
Homebrew
~~~~~~~~
There is some :ref:`instruction
<https://github.com/samueljohn/homebrew-python>` on how to install
Theano dependencies with Homebrew instead of MacPort by Samuel John.
.. _gpu_macos:
Using the GPU
...
...
doc/library/tensor/basic.txt
浏览文件 @
5237b952
...
...
@@ -1220,6 +1220,7 @@ Linear Algebra
:param x: A Tensor with sizes e.g.: for 3D (dim1, dim3, dim2)
:param y: A Tensor with sizes e.g.: for 3D (dim1, dim2, dim4)
This function computes the dot product between the two tensors, by iterating
over the first dimension using scan.
Returns a tensor of size e.g. if it is 3D: (dim1, dim3, dim4)
...
...
doc/tutorial/debug_faq.txt
浏览文件 @
5237b952
...
...
@@ -230,10 +230,10 @@ shows how to print all inputs and outputs:
import theano
def inspect_inputs(i, node, fn):
print i, node, [input[0] for input in fn.inputs],
print i, node,
"input(s) value(s):",
[input[0] for input in fn.inputs],
def inspect_outputs(i, node, fn):
print [output[0] for output in fn.outputs]
print
"output(s) value(s):",
[output[0] for output in fn.outputs]
x = theano.tensor.dscalar('x')
f = theano.function([x], [5 * x],
...
...
doc/tutorial/examples.txt
浏览文件 @
5237b952
...
...
@@ -433,12 +433,12 @@ to another is shown below.
This gives the following output:
.. code-block::
shell
.. code-block::
bash
By default, the two functions are out of sync.
#
By default, the two functions are out of sync.
f1() returns [ 0.72803009]
f2() returns [ 0.55056769]
We now copy the state of the theano random number generators.
#
We now copy the state of the theano random number generators.
f1() returns [ 0.59044123]
f2() returns [ 0.59044123]
...
...
theano/gradient.py
浏览文件 @
5237b952
...
...
@@ -384,11 +384,11 @@ def grad(cost, wrt, consider_constant=None,
:type return_disconnected: string
:param return_disconnected:
'zero' : If wrt[i] is disconnected, return value i will be
-
'zero' : If wrt[i] is disconnected, return value i will be
wrt[i].zeros_like()
'None' : If wrt[i] is disconnected, return value i will be
-
'None' : If wrt[i] is disconnected, return value i will be
None
'Disconnected' : returns variables of type DisconnectedType
-
'Disconnected' : returns variables of type DisconnectedType
:rtype: Variable or list/tuple of Variables (depending upon `wrt`)
...
...
theano/misc/check_blas.py
浏览文件 @
5237b952
...
...
@@ -67,10 +67,9 @@ def execute(execute=True, verbose=True, M=2000, N=2000, K=2000,
order
=
order
))
c
=
theano
.
shared
(
numpy
.
ones
((
M
,
K
),
dtype
=
theano
.
config
.
floatX
,
order
=
order
))
f
=
theano
.
function
([],
updates
=
{
c
:
0.4
*
c
+
.
8
*
T
.
dot
(
a
,
b
)}
,
f
=
theano
.
function
([],
updates
=
[(
c
,
0.4
*
c
+
.
8
*
T
.
dot
(
a
,
b
))]
,
mode
=
theano
.
compile
.
ProfileMode
())
if
any
([
x
.
op
.
__class__
.
__name__
==
'Gemm'
for
x
in
f
.
maker
.
fgraph
.
toposort
()]):
c_impl
=
f
.
profile
.
apply_cimpl
.
values
()
...
...
@@ -206,6 +205,8 @@ if __name__ == "__main__":
GTX470/4.2 0.238s
C2075/4.2 0.25s
GTX285/4.2 0.452s #cuda 3.0 seam faster? driver version?
GT520/4.2 2.68s
GTX560/4.2 0.30s
GTX460/4.0 0.45s
...
...
theano/sandbox/cuda/basic_ops.py
浏览文件 @
5237b952
...
...
@@ -2443,9 +2443,10 @@ class GpuIncSubtensor(tensor.IncSubtensor, GpuOp):
def
copy_of_x
(
self
,
x
):
"""
x: a string giving the name of a C variable pointing to an array
:param x: a string giving the name of a C variable
pointing to an array
Returns C code expression to make a copy of x.
:return: C code expression to make a copy of x
Base class uses PyArrayObject *, subclasses may override for
different types of arrays.
...
...
@@ -2454,8 +2455,8 @@ class GpuIncSubtensor(tensor.IncSubtensor, GpuOp):
def
make_view_array
(
self
,
x
,
view_ndim
):
"""
x: a string identifying an array to be viewed
view_ndim: a string specifying the number of dimensions
:param
x: a string identifying an array to be viewed
:param
view_ndim: a string specifying the number of dimensions
to have in the view
This doesn't need to actually set up the view with the
...
...
theano/tensor/basic.py
浏览文件 @
5237b952
...
...
@@ -4971,9 +4971,10 @@ class IncSubtensor(Op):
def
copy_of_x
(
self
,
x
):
"""
x: a string giving the name of a C variable pointing to an array
:param x: a string giving the name of a C variable
pointing to an array
Returns C code expression to make a copy of x.
:return: C code expression to make a copy of x
Base class uses PyArrayObject *, subclasses may override for
different types of arrays.
...
...
@@ -4991,8 +4992,8 @@ class IncSubtensor(Op):
def
make_view_array
(
self
,
x
,
view_ndim
):
"""
x: a string identifying an array to be viewed
view_ndim: a string specifying the number of dimensions
:param
x: a string identifying an array to be viewed
:param
view_ndim: a string specifying the number of dimensions
to have in the view
This doesn't need to actually set up the view with the
...
...
theano/tensor/tests/test_basic.py
浏览文件 @
5237b952
...
...
@@ -7119,10 +7119,12 @@ class TestTensorInstanceMethods(unittest.TestCase):
def
test_dot
(
self
):
X
,
Y
=
self
.
vars
x
,
y
=
self
.
vals
assert_array_equal
(
x
.
dot
(
y
),
X
.
dot
(
Y
)
.
eval
({
X
:
x
,
Y
:
y
}))
# Use allclose comparison as a user reported on the mailing
# list failure otherwise with array that print exactly the same.
assert_allclose
(
x
.
dot
(
y
),
X
.
dot
(
Y
)
.
eval
({
X
:
x
,
Y
:
y
}))
Z
=
X
.
dot
(
Y
)
z
=
x
.
dot
(
y
)
assert_a
rray_equal
(
x
.
dot
(
z
),
X
.
dot
(
Z
)
.
eval
({
X
:
x
,
Z
:
z
}))
assert_a
llclose
(
x
.
dot
(
z
),
X
.
dot
(
Z
)
.
eval
({
X
:
x
,
Z
:
z
}))
def
test_real_imag
(
self
):
X
,
Y
=
self
.
vars
...
...
theano/tests/run_tests_in_batch.py
浏览文件 @
5237b952
...
...
@@ -240,9 +240,30 @@ def run(stdout, stderr, argv, theano_nose, batch_size, time_profile,
prof_master_nosort
=
[]
prof_rawlog
=
[]
dummy_out
=
open
(
os
.
devnull
,
'w'
)
path_rawlog
=
os
.
path
.
join
(
sav_dir
,
'timeprof_rawlog'
)
stamp
=
str
(
datetime
.
datetime
.
now
())
+
'
\n\n
'
f_rawlog
=
open
(
path_rawlog
,
'w'
)
f_rawlog
.
write
(
'TIME-PROFILING OF THEANO
\'
S NOSETESTS'
' (raw log)
\n\n
'
+
stamp
)
f_rawlog
.
flush
()
stamp
=
str
(
datetime
.
datetime
.
now
())
+
'
\n\n
'
fields
=
(
'Fields: computation time; nosetests sequential id;'
' test name; parent class (if any); outcome
\n\n
'
)
path_nosort
=
os
.
path
.
join
(
sav_dir
,
'timeprof_nosort'
)
f_nosort
=
open
(
path_nosort
,
'w'
)
f_nosort
.
write
(
'TIME-PROFILING OF THEANO
\'
S NOSETESTS'
' (by sequential id)
\n\n
'
+
stamp
+
fields
)
f_nosort
.
flush
()
for
test_floor
in
xrange
(
1
,
n_tests
+
1
,
batch_size
):
for
test_id
in
xrange
(
test_floor
,
min
(
test_floor
+
batch_size
,
n_tests
+
1
)):
# Print the test we will start in the raw log to help
# debug tests that are too long.
f_rawlog
.
write
(
"
\n
Will run test #
%
d
%
s
\n
"
%
(
test_id
,
data
[
"ids"
][
test_id
]))
f_rawlog
.
flush
()
proc
=
subprocess
.
Popen
(
([
python
,
theano_nose
,
'-v'
,
'--with-id'
]
+
[
str
(
test_id
)]
+
argv
+
...
...
@@ -257,8 +278,10 @@ def run(stdout, stderr, argv, theano_nose, batch_size, time_profile,
# recovering and processing data from pipe
err
=
proc
.
stderr
.
read
()
# building the raw log
prof_rawlog
.
append
(
err
)
# print the raw log
f_rawlog
.
write
(
err
)
f_rawlog
.
flush
()
# parsing the output
l_err
=
err
.
split
()
try
:
...
...
@@ -292,34 +315,31 @@ def run(stdout, stderr, argv, theano_nose, batch_size, time_profile,
' on test'
)
prof_pass
=
''
prof_tuple
=
(
prof_time
,
prof_id
,
prof_test
,
prof_pass
)
# appending tuple to master list
prof_master_nosort
.
append
(
prof_tuple
)
# write the no sort file
s_nosort
=
((
str
(
prof_tuple
[
0
])
+
's'
)
.
ljust
(
10
)
+
" "
+
prof_tuple
[
1
]
.
ljust
(
7
)
+
" "
+
prof_tuple
[
2
]
+
prof_tuple
[
3
]
+
"
\n
"
)
f_nosort
.
write
(
s_nosort
)
f_nosort
.
flush
()
print
'
%
s
%%
time-profiled'
%
((
test_id
*
100
)
//
n_tests
)
f_rawlog
.
close
()
# sorting tests according to running-time
prof_master_sort
=
sorted
(
prof_master_nosort
,
key
=
lambda
test
:
test
[
0
],
reverse
=
True
)
# saving results to readable files
path_nosort
=
os
.
path
.
join
(
sav_dir
,
'timeprof_nosort'
)
path_sort
=
os
.
path
.
join
(
sav_dir
,
'timeprof_sort'
)
path_rawlog
=
os
.
path
.
join
(
sav_dir
,
'timeprof_rawlog'
)
f_nosort
=
open
(
path_nosort
,
'w'
)
f_sort
=
open
(
path_sort
,
'w'
)
f_rawlog
=
open
(
path_rawlog
,
'w'
)
stamp
=
str
(
datetime
.
datetime
.
now
())
+
'
\n\n
'
fields
=
(
'Fields: computation time; nosetests sequential id;'
' test name; parent class (if any); outcome
\n\n
'
)
f_nosort
.
write
(
'TIME-PROFILING OF THEANO
\'
S NOSETESTS'
' (by sequential id)
\n\n
'
+
stamp
+
fields
)
f_sort
.
write
(
'TIME-PROFILING OF THEANO
\'
S NOSETESTS'
' (sorted by computation time)
\n\n
'
+
stamp
+
fields
)
for
i
in
xrange
(
len
(
prof_master_nosort
)):
s_nosort
=
((
str
(
prof_master_nosort
[
i
][
0
])
+
's'
)
.
ljust
(
10
)
+
" "
+
prof_master_nosort
[
i
][
1
]
.
ljust
(
7
)
+
" "
+
prof_master_nosort
[
i
][
2
]
+
prof_master_nosort
[
i
][
3
]
+
"
\n
"
)
f_nosort
.
write
(
s_nosort
)
s_sort
=
((
str
(
prof_master_sort
[
i
][
0
])
+
's'
)
.
ljust
(
10
)
+
" "
+
prof_master_sort
[
i
][
1
]
.
ljust
(
7
)
+
" "
+
prof_master_sort
[
i
][
2
]
+
prof_master_sort
[
i
][
3
]
+
...
...
@@ -327,11 +347,6 @@ def run(stdout, stderr, argv, theano_nose, batch_size, time_profile,
f_sort
.
write
(
s_sort
)
f_nosort
.
close
()
f_sort
.
close
()
f_rawlog
.
write
(
'TIME-PROFILING OF THEANO
\'
S NOSETESTS'
' (raw log)
\n\n
'
+
stamp
)
for
i
in
xrange
(
len
(
prof_rawlog
)):
f_rawlog
.
write
(
prof_rawlog
[
i
])
f_rawlog
.
close
()
if
__name__
==
'__main__'
:
sys
.
exit
(
main
())
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论