Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
365b05d1
提交
365b05d1
authored
6月 18, 2013
作者:
lamblin
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #1423 from nouiz/fixes
Fixes
上级
2f1c91cb
b9b7dfb4
显示空白字符变更
内嵌
并排
正在显示
8 个修改的文件
包含
50 行增加
和
18 行删除
+50
-18
nnet.txt
doc/library/tensor/nnet/nnet.txt
+8
-1
profiling.py
theano/compile/profiling.py
+2
-1
configdefaults.py
theano/configdefaults.py
+2
-1
compiledir.py
theano/gof/compiledir.py
+6
-3
test_cmodule.py
theano/gof/tests/test_cmodule.py
+8
-2
vm.py
theano/gof/vm.py
+8
-5
__init__.py
theano/sandbox/cuda/__init__.py
+4
-2
nvcc_compiler.py
theano/sandbox/cuda/nvcc_compiler.py
+12
-3
没有找到文件。
doc/library/tensor/nnet/nnet.txt
浏览文件 @
365b05d1
...
@@ -66,7 +66,10 @@
...
@@ -66,7 +66,10 @@
minimum value and 0.997527376843 as the maximum value. So it
minimum value and 0.997527376843 as the maximum value. So it
never returns 0 or 1.
never returns 0 or 1.
.. note:: Using directly the ultra_fast_sigmoid in the graph will
disable stabilization optimization associated with it. But
using the optimization to insert them won't disable the
stability optimization.
.. function:: hard_sigmoid(x)
.. function:: hard_sigmoid(x)
...
@@ -84,6 +87,10 @@
...
@@ -84,6 +87,10 @@
.. note:: The underlying code will return an exact 0 or 1 if an
.. note:: The underlying code will return an exact 0 or 1 if an
element of x is too small or too big.
element of x is too small or too big.
.. note:: Using directly the ultra_fast_sigmoid in the graph will
disable stabilization optimization associated with it. But
using the optimization to insert them won't disable the
stability optimization.
.. function:: softplus(x)
.. function:: softplus(x)
...
...
theano/compile/profiling.py
浏览文件 @
365b05d1
...
@@ -34,7 +34,8 @@ _atexit_print_file = sys.stderr
...
@@ -34,7 +34,8 @@ _atexit_print_file = sys.stderr
AddConfigVar
(
'profiling.time_thunks'
,
AddConfigVar
(
'profiling.time_thunks'
,
"""Time individual thunks when profiling"""
,
"""Time individual thunks when profiling"""
,
BoolParam
(
True
))
BoolParam
(
True
),
in_c_key
=
False
)
AddConfigVar
(
'profiling.n_apply'
,
AddConfigVar
(
'profiling.n_apply'
,
"Number of Apply instances to print by default"
,
"Number of Apply instances to print by default"
,
...
...
theano/configdefaults.py
浏览文件 @
365b05d1
...
@@ -234,7 +234,8 @@ AddConfigVar('op.set_flops',
...
@@ -234,7 +234,8 @@ AddConfigVar('op.set_flops',
AddConfigVar
(
'gpuelemwise.sync'
,
AddConfigVar
(
'gpuelemwise.sync'
,
"when true, wait that the gpu fct finished and check it error code."
,
"when true, wait that the gpu fct finished and check it error code."
,
BoolParam
(
True
))
BoolParam
(
True
),
in_c_key
=
False
)
AddConfigVar
(
'traceback.limit'
,
AddConfigVar
(
'traceback.limit'
,
"The number of stack to trace. -1 mean all."
,
"The number of stack to trace. -1 mean all."
,
...
...
theano/gof/compiledir.py
浏览文件 @
365b05d1
...
@@ -80,7 +80,8 @@ AddConfigVar("compiledir_format",
...
@@ -80,7 +80,8 @@ AddConfigVar("compiledir_format",
module subdirectory (relative to base_compiledir).
module subdirectory (relative to base_compiledir).
Available keys:
%
s. Defaults to
%
r.
Available keys:
%
s. Defaults to
%
r.
"""
%
(
compiledir_format_keys
,
default_compiledir_format
))),
"""
%
(
compiledir_format_keys
,
default_compiledir_format
))),
StrParam
(
default_compiledir_format
,
allow_override
=
False
))
StrParam
(
default_compiledir_format
,
allow_override
=
False
),
in_c_key
=
False
)
def
default_compiledirname
():
def
default_compiledirname
():
...
@@ -160,7 +161,8 @@ AddConfigVar('base_compiledir',
...
@@ -160,7 +161,8 @@ AddConfigVar('base_compiledir',
ConfigParam
(
ConfigParam
(
default_base_compiledir
,
default_base_compiledir
,
filter
=
filter_base_compiledir
,
filter
=
filter_base_compiledir
,
allow_override
=
False
))
allow_override
=
False
),
in_c_key
=
False
)
AddConfigVar
(
'compiledir'
,
AddConfigVar
(
'compiledir'
,
"platform-dependent cache directory for compiled modules"
,
"platform-dependent cache directory for compiled modules"
,
...
@@ -169,7 +171,8 @@ AddConfigVar('compiledir',
...
@@ -169,7 +171,8 @@ AddConfigVar('compiledir',
config
.
base_compiledir
,
config
.
base_compiledir
,
default_compiledirname
()),
default_compiledirname
()),
filter
=
filter_compiledir
,
filter
=
filter_compiledir
,
allow_override
=
False
))
allow_override
=
False
),
in_c_key
=
False
)
def
cleanup
():
def
cleanup
():
...
...
theano/gof/tests/test_cmodule.py
浏览文件 @
365b05d1
...
@@ -41,13 +41,19 @@ def test_inter_process_cache():
...
@@ -41,13 +41,19 @@ def test_inter_process_cache():
"""
"""
x
,
y
=
theano
.
tensor
.
vectors
(
'xy'
)
x
,
y
=
theano
.
tensor
.
d
vectors
(
'xy'
)
f
=
theano
.
function
([
x
,
y
],
[
MyOp
()(
x
),
MyOp
()(
y
)])
f
=
theano
.
function
([
x
,
y
],
[
MyOp
()(
x
),
MyOp
()(
y
)])
f
(
numpy
.
arange
(
60
),
numpy
.
arange
(
60
))
f
(
numpy
.
arange
(
60
),
numpy
.
arange
(
60
))
if
theano
.
config
.
mode
==
'FAST_COMPILE'
:
assert
MyOp
.
nb_called
==
0
else
:
assert
MyOp
.
nb_called
==
1
assert
MyOp
.
nb_called
==
1
# What if we compile a new function with new variables?
# What if we compile a new function with new variables?
x
,
y
=
theano
.
tensor
.
vectors
(
'xy'
)
x
,
y
=
theano
.
tensor
.
d
vectors
(
'xy'
)
f
=
theano
.
function
([
x
,
y
],
[
MyOp
()(
x
),
MyOp
()(
y
)])
f
=
theano
.
function
([
x
,
y
],
[
MyOp
()(
x
),
MyOp
()(
y
)])
f
(
numpy
.
arange
(
60
),
numpy
.
arange
(
60
))
f
(
numpy
.
arange
(
60
),
numpy
.
arange
(
60
))
if
theano
.
config
.
mode
==
'FAST_COMPILE'
:
assert
MyOp
.
nb_called
==
0
else
:
assert
MyOp
.
nb_called
==
1
assert
MyOp
.
nb_called
==
1
theano/gof/vm.py
浏览文件 @
365b05d1
...
@@ -20,14 +20,16 @@ logger = logging.getLogger(__name__)
...
@@ -20,14 +20,16 @@ logger = logging.getLogger(__name__)
AddConfigVar
(
'profile'
,
AddConfigVar
(
'profile'
,
"If VM should collect profile information"
,
"If VM should collect profile information"
,
BoolParam
(
False
))
BoolParam
(
False
),
in_c_key
=
False
)
AddConfigVar
(
'profile_optimizer'
,
AddConfigVar
(
'profile_optimizer'
,
"If VM should collect optimizer profile information"
,
"If VM should collect optimizer profile information"
,
BoolParam
(
False
))
BoolParam
(
False
),
in_c_key
=
False
)
AddConfigVar
(
'profile_memory'
,
AddConfigVar
(
'profile_memory'
,
"If VM should collect memory profile information and print it"
,
"If VM should collect memory profile information and print it"
,
BoolParam
(
False
)
)
BoolParam
(
False
)
,
in_c_key
=
False
)
def
filter_vm_lazy
(
val
):
def
filter_vm_lazy
(
val
):
if
val
==
'False'
or
val
is
False
:
if
val
==
'False'
or
val
is
False
:
...
@@ -45,7 +47,8 @@ AddConfigVar('vm.lazy',
...
@@ -45,7 +47,8 @@ AddConfigVar('vm.lazy',
" auto detect if lazy evaluation is needed and use the apropriate"
" auto detect if lazy evaluation is needed and use the apropriate"
" version. If lazy is True/False, force the version used between"
" version. If lazy is True/False, force the version used between"
" Loop/LoopGC and Stack."
,
" Loop/LoopGC and Stack."
,
ConfigParam
(
'None'
,
filter_vm_lazy
))
ConfigParam
(
'None'
,
filter_vm_lazy
),
in_c_key
=
False
)
raise_with_op
=
link
.
raise_with_op
raise_with_op
=
link
.
raise_with_op
...
...
theano/sandbox/cuda/__init__.py
浏览文件 @
365b05d1
...
@@ -27,7 +27,8 @@ AddConfigVar('cuda.root',
...
@@ -27,7 +27,8 @@ AddConfigVar('cuda.root',
linker directives. Default: environment variable "CUDA_ROOT"
linker directives. Default: environment variable "CUDA_ROOT"
or else "AUTO".
or else "AUTO".
"""
,
"""
,
StrParam
(
os
.
getenv
(
'CUDA_ROOT'
,
"AUTO"
)))
StrParam
(
os
.
getenv
(
'CUDA_ROOT'
,
"AUTO"
)),
in_c_key
=
False
)
AddConfigVar
(
'pycuda.init'
,
AddConfigVar
(
'pycuda.init'
,
"""If True, always initialize PyCUDA when Theano want to
"""If True, always initialize PyCUDA when Theano want to
...
@@ -37,7 +38,8 @@ AddConfigVar('pycuda.init',
...
@@ -37,7 +38,8 @@ AddConfigVar('pycuda.init',
manually by importing theano.misc.pycuda_init before theano
manually by importing theano.misc.pycuda_init before theano
initialize the GPU device.
initialize the GPU device.
"""
,
"""
,
BoolParam
(
False
))
BoolParam
(
False
),
in_c_key
=
False
)
if
config
.
cuda
.
root
==
"AUTO"
:
if
config
.
cuda
.
root
==
"AUTO"
:
# set nvcc_path correctly and get the version
# set nvcc_path correctly and get the version
...
...
theano/sandbox/cuda/nvcc_compiler.py
浏览文件 @
365b05d1
...
@@ -27,7 +27,8 @@ from theano.configparser import (config, AddConfigVar, StrParam,
...
@@ -27,7 +27,8 @@ from theano.configparser import (config, AddConfigVar, StrParam,
AddConfigVar
(
'nvcc.compiler_bindir'
,
AddConfigVar
(
'nvcc.compiler_bindir'
,
"If defined, nvcc compiler driver will seek g++ and gcc"
"If defined, nvcc compiler driver will seek g++ and gcc"
" in this directory"
,
" in this directory"
,
StrParam
(
""
))
StrParam
(
""
),
in_c_key
=
False
)
AddConfigVar
(
'cuda.nvccflags'
,
AddConfigVar
(
'cuda.nvccflags'
,
"DEPRECATED, use nvcc.flags instead"
,
"DEPRECATED, use nvcc.flags instead"
,
...
@@ -52,12 +53,20 @@ def filter_nvcc_flags(s):
...
@@ -52,12 +53,20 @@ def filter_nvcc_flags(s):
return
' '
.
join
(
flags
)
return
' '
.
join
(
flags
)
AddConfigVar
(
'nvcc.flags'
,
AddConfigVar
(
'nvcc.flags'
,
"Extra compiler flags for nvcc"
,
"Extra compiler flags for nvcc"
,
ConfigParam
(
config
.
cuda
.
nvccflags
,
filter_nvcc_flags
))
ConfigParam
(
config
.
cuda
.
nvccflags
,
filter_nvcc_flags
),
# Not needed in c key as it is already added.
# We remove it as we don't make the md5 of config to change
# if theano.sandbox.cuda is loaded or not.
in_c_key
=
False
)
AddConfigVar
(
'nvcc.fastmath'
,
AddConfigVar
(
'nvcc.fastmath'
,
""
,
""
,
BoolParam
(
False
))
BoolParam
(
False
),
# Not needed in c key as it is already added.
# We remove it as we don't make the md5 of config to change
# if theano.sandbox.cuda is loaded or not.
in_c_key
=
False
)
nvcc_path
=
'nvcc'
nvcc_path
=
'nvcc'
nvcc_version
=
None
nvcc_version
=
None
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论