Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
f4edcc59
提交
f4edcc59
authored
7月 22, 2015
作者:
Frédéric Bastien
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #3186 from nouiz/mixed
Mixed
上级
406e9fe7
d8e7531e
隐藏空白字符变更
内嵌
并排
正在显示
10 个修改的文件
包含
61 行增加
和
13 行删除
+61
-13
dnn.txt
doc/library/sandbox/cuda/dnn.txt
+5
-0
examples.txt
doc/tutorial/examples.txt
+11
-3
basic_ops.py
theano/sandbox/cuda/basic_ops.py
+3
-0
opt_util.py
theano/sandbox/cuda/opt_util.py
+14
-2
basic_ops.py
theano/sandbox/gpuarray/basic_ops.py
+2
-0
opt_util.py
theano/sandbox/gpuarray/opt_util.py
+14
-2
basic.py
theano/tensor/basic.py
+3
-0
subtensor.py
theano/tensor/subtensor.py
+2
-0
test_basic.py
theano/tensor/tests/test_basic.py
+6
-5
test_casting.py
theano/tensor/tests/test_casting.py
+1
-1
没有找到文件。
doc/library/sandbox/cuda/dnn.txt
浏览文件 @
f4edcc59
...
...
@@ -63,6 +63,11 @@ To get an error if Theano can not use cuDNN, use this Theano flag:
There is a problem we do not understand yet when cudnn paths are
used with symbolic links. So avoid using that.
.. note::
cudnn.so* must be readable and executable by everybody.
cudnn.h must be readable by everybody.
Functions
=========
...
...
doc/tutorial/examples.txt
浏览文件 @
f4edcc59
...
...
@@ -465,11 +465,19 @@ There are :ref:`other distributions implemented <libdoc_tensor_raw_random>`.
Other Implementations
---------------------
There is 2 other implementations based on :
class:`CURAND
<
theano.sandbox.cuda.rng_curand>` and :ref:`MRG31k3p
<libdoc_rng_mrg>`.
The RandomStream only work on the CPU, MRG31k3p
There is 2 other implementations based on :
ref:`MRG31k3p
<
libdoc_rng_mrg>` and :class:`CURAND <theano.sandbox.cuda.rng_curand>`.
The RandomStream only work on the CPU, MRG31k3p
work on the CPU and GPU. CURAND only work on the GPU.
.. note::
To use you the MRG version easily, you can just change the import to:
.. code-block:: python
from theano.sandbox.rng_mrg import MRG_RandomStreams as RandomStreams
.. _logistic_regression:
...
...
theano/sandbox/cuda/basic_ops.py
浏览文件 @
f4edcc59
...
...
@@ -3539,6 +3539,9 @@ class GpuAllocEmpty(GpuOp):
def
make_node
(
self
,
*
shape
):
shape
,
output
=
self
.
validate_shape
(
shape
)
output
.
tag
.
values_eq_approx
=
tensor
.
type
.
values_eq_approx_always_true
# The outut can contain nan/inf. output.type is a new
# instance, so we can do this only for that variable.
output
.
type
.
filter_checks_isfinite
=
False
return
Apply
(
self
,
shape
,
[
output
])
def
perform
(
self
,
node
,
inputs
,
out_
):
...
...
theano/sandbox/cuda/opt_util.py
浏览文件 @
f4edcc59
...
...
@@ -73,8 +73,20 @@ def alpha_merge(cls, alpha_in, beta_in, nd):
if
lr
is
None
or
targ
is
None
:
return
None
inputs
=
list
(
targ
.
inputs
)
inputs
[
alpha_in
]
=
lr
*
targ
.
inputs
[
alpha_in
]
inputs
[
beta_in
]
=
lr
*
targ
.
inputs
[
beta_in
]
try
:
c
=
get_scalar_constant_value
(
lr
)
if
c
==
0
:
inputs
[
alpha_in
]
=
lr
inputs
[
beta_in
]
=
lr
elif
c
==
1
:
inputs
[
alpha_in
]
=
targ
.
inputs
[
alpha_in
]
inputs
[
beta_in
]
=
targ
.
inputs
[
beta_in
]
else
:
inputs
[
alpha_in
]
=
lr
*
targ
.
inputs
[
alpha_in
]
inputs
[
beta_in
]
=
lr
*
targ
.
inputs
[
beta_in
]
except
NotScalarConstantError
:
inputs
[
alpha_in
]
=
lr
*
targ
.
inputs
[
alpha_in
]
inputs
[
beta_in
]
=
lr
*
targ
.
inputs
[
beta_in
]
return
maker
(
targ
,
*
inputs
)
return
opt
return
wrapper
...
...
theano/sandbox/gpuarray/basic_ops.py
浏览文件 @
f4edcc59
...
...
@@ -713,6 +713,8 @@ class GpuAllocEmpty(HideC, Alloc):
sh
,
bcast
=
self
.
validate_shape
(
shape
)
output
=
GpuArrayType
(
dtype
=
self
.
dtype
,
broadcastable
=
bcast
)()
output
.
tag
.
values_eq_approx
=
tensor
.
type
.
values_eq_approx_always_true
# The outut can contain nan/inf.
output
.
type
.
filter_checks_isfinite
=
False
return
Apply
(
self
,
sh
,
[
output
])
def
perform
(
self
,
node
,
inputs
,
out_
):
...
...
theano/sandbox/gpuarray/opt_util.py
浏览文件 @
f4edcc59
...
...
@@ -75,8 +75,20 @@ def alpha_merge(cls, alpha_in, beta_in, nd):
if
lr
is
None
or
targ
is
None
:
return
None
inputs
=
list
(
targ
.
inputs
)
inputs
[
alpha_in
]
=
lr
*
targ
.
inputs
[
alpha_in
]
inputs
[
beta_in
]
=
lr
*
targ
.
inputs
[
beta_in
]
try
:
c
=
get_scalar_constant_value
(
lr
)
if
c
==
0
:
inputs
[
alpha_in
]
=
lr
inputs
[
beta_in
]
=
lr
elif
c
==
1
:
inputs
[
alpha_in
]
=
targ
.
inputs
[
alpha_in
]
inputs
[
beta_in
]
=
targ
.
inputs
[
beta_in
]
else
:
inputs
[
alpha_in
]
=
lr
*
targ
.
inputs
[
alpha_in
]
inputs
[
beta_in
]
=
lr
*
targ
.
inputs
[
beta_in
]
except
NotScalarConstantError
:
inputs
[
alpha_in
]
=
lr
*
targ
.
inputs
[
alpha_in
]
inputs
[
beta_in
]
=
lr
*
targ
.
inputs
[
beta_in
]
return
maker
(
targ
,
*
inputs
)
return
opt
return
wrapper
...
...
theano/tensor/basic.py
浏览文件 @
f4edcc59
...
...
@@ -5709,6 +5709,9 @@ class AllocEmpty(gof.Op):
def
make_node
(
self
,
*
shape
):
shape
,
output
=
self
.
validate_shape
(
shape
)
output
.
tag
.
values_eq_approx
=
values_eq_approx_always_true
# The outut can contain nan/inf. output.type is a new
# instance, so we can do this only for that variable.
output
.
type
.
filter_checks_isfinite
=
False
return
Apply
(
self
,
shape
,
[
output
])
def
perform
(
self
,
node
,
inputs
,
out_
):
...
...
theano/tensor/subtensor.py
浏览文件 @
f4edcc59
...
...
@@ -1009,6 +1009,8 @@ def inc_subtensor(x, y, inplace=False, set_instead_of_inc=False,
:param x: the symbolic result of a Subtensor operation.
:param y: the amount by which to increment ths subtensor in question
:param inplace: Don't use. Theano will do it when possible.
:param set_instead_of_inc: If True, do a set_subtensor instead.
:param tolerate_inplace_aliasing: allow x and y to be views of a single
underlying array even while working inplace. For correct results,
x and y must not be overlapping views; if they overlap, the result
...
...
theano/tensor/tests/test_basic.py
浏览文件 @
f4edcc59
...
...
@@ -4898,13 +4898,9 @@ class T_reshape(utt.InferShapeTester, utt.TestOptimizationMixin):
topo_
=
[
node
for
node
in
topo
if
not
isinstance
(
node
.
op
,
self
.
ignore_topo
)]
assert
len
(
topo_
)
==
1
,
topo_
assert
type
(
topo_
[
0
]
.
op
)
is
self
.
op
return
f
def
eval_output_and_check
(
self
,
t
):
f
=
self
.
function
([],
t
)
tval
=
f
()
return
tval
def
test_reshape
(
self
):
a
=
dvector
()
b
=
dmatrix
()
...
...
@@ -5020,6 +5016,11 @@ class T_reshape(utt.InferShapeTester, utt.TestOptimizationMixin):
self
.
assertRaises
(
ValueError
,
f
,
a_val
,
[
7
,
5
])
self
.
assertRaises
(
ValueError
,
f
,
a_val
,
[
-
1
,
-
1
])
def
test_0
(
self
):
x
=
fvector
(
'x'
)
f
=
self
.
function
([
x
],
x
.
reshape
((
0
,
100
)))
assert
f
(
numpy
.
ndarray
((
0
,),
dtype
=
'float32'
))
.
shape
==
(
0
,
100
)
def
test_make_column_matrix_broadcastable
():
# The goal of the operation made by `b` is to ensure the second dimension
...
...
theano/tensor/tests/test_casting.py
浏览文件 @
f4edcc59
...
...
@@ -34,7 +34,7 @@ class test_casting(unittest.TestCase):
for
type1
in
[
'uint8'
,
'uint16'
,
'uint32'
,
'uint64'
,
'int8'
,
'int16'
,
'int32'
,
'int64'
,
'float32'
,
'float64'
]:
x
=
TensorType
(
dtype
=
type1
,
broadcastable
=
(
False
,
))
.
make_variable
()
broadcastable
=
(
False
,
))()
for
type2
,
converter
in
zip
([
'int8'
,
'int16'
,
'int32'
,
'int64'
,
'float32'
,
'float64'
],
[
_convert_to_int8
,
_convert_to_int16
,
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论