Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
58868b92
提交
58868b92
authored
6月 26, 2014
作者:
abergeron
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #1924 from delallea/minor
Typos
上级
7af51a52
cb07003d
隐藏空白字符变更
内嵌
并排
正在显示
9 个修改的文件
包含
43 行增加
和
44 行删除
+43
-44
install_ubuntu.txt
doc/install_ubuntu.txt
+2
-2
index.txt
doc/library/sparse/index.txt
+1
-1
basic.txt
doc/library/tensor/basic.txt
+1
-1
typed_list.txt
doc/library/typed_list.txt
+1
-1
ops.py
theano/compile/ops.py
+9
-10
basic.py
theano/sparse/basic.py
+22
-22
basic.py
theano/tensor/basic.py
+1
-1
conv.py
theano/tensor/signal/conv.py
+1
-1
basic.py
theano/typed_list/basic.py
+5
-5
没有找到文件。
doc/install_ubuntu.txt
浏览文件 @
58868b92
...
@@ -3,8 +3,8 @@
...
@@ -3,8 +3,8 @@
Easy Installation of an optimized Theano on Ubuntu
Easy Installation of an optimized Theano on Ubuntu
==================================================
==================================================
These instruction
was done
for Ubuntu 11.04, 11.10, 12.04, 12.10, 13.04
These instruction
s were written
for Ubuntu 11.04, 11.10, 12.04, 12.10, 13.04
and 13.10. You can probably do something similar on older
computer
.
and 13.10. You can probably do something similar on older
versions
.
.. note::
.. note::
...
...
doc/library/sparse/index.txt
浏览文件 @
58868b92
...
@@ -124,7 +124,7 @@ List of Implemented Operations
...
@@ -124,7 +124,7 @@ List of Implemented Operations
- :func:`csr_from_dense <theano.sparse.basic.csr_from_dense>`,
- :func:`csr_from_dense <theano.sparse.basic.csr_from_dense>`,
:func:`csc_from_dense <theano.sparse.basic.csc_from_dense>`.
:func:`csc_from_dense <theano.sparse.basic.csc_from_dense>`.
The grad implemented is structured.
The grad implemented is structured.
- Theano SparseVariable object have a method ``toarray()`` that is the same as
- Theano SparseVariable object
s
have a method ``toarray()`` that is the same as
:func:`dense_from_sparse <theano.sparse.basic.dense_from_sparse>`.
:func:`dense_from_sparse <theano.sparse.basic.dense_from_sparse>`.
- Construction of Sparses and their Properties
- Construction of Sparses and their Properties
...
...
doc/library/tensor/basic.txt
浏览文件 @
58868b92
...
@@ -1346,7 +1346,7 @@ Mathematical
...
@@ -1346,7 +1346,7 @@ Mathematical
sometimes more accurate).
sometimes more accurate).
C code is provided in the Theano_lgpl repository.
C code is provided in the Theano_lgpl repository.
This make it faster.
This make
s
it faster.
https://github.com/Theano/Theano_lgpl.git
https://github.com/Theano/Theano_lgpl.git
...
...
doc/library/typed_list.txt
浏览文件 @
58868b92
...
@@ -22,7 +22,7 @@ the same Theano type. Here is an example::
...
@@ -22,7 +22,7 @@ the same Theano type. Here is an example::
A second example with Scan. Scan doesn't yet have direct support of
A second example with Scan. Scan doesn't yet have direct support of
TypedList, so you can only use it as non_sequences (not in sequences or
TypedList, so you can only use it as non_sequences (not in sequences or
as outputs)
.
::
as outputs)::
import theano.typed_list
import theano.typed_list
...
...
theano/compile/ops.py
浏览文件 @
58868b92
...
@@ -16,9 +16,9 @@ import numpy
...
@@ -16,9 +16,9 @@ import numpy
def
register_view_op_c_code
(
type
,
code
,
version
=
()):
def
register_view_op_c_code
(
type
,
code
,
version
=
()):
""" Tell ViewOp how to generate C code for a Theano Type
""" Tell ViewOp how to generate C code for a Theano Type
:param typ: A Theano type. It must be the Theano class itself and not an
:param typ
e
: A Theano type. It must be the Theano class itself and not an
instance of the class.
instance of the class.
:param code: C code that return
a view for the Theano type 'typ
'.
:param code: C code that return
s a view for the Theano type 'type
'.
Use
%(iname)
s and
%(oname)
s for the input and output C
Use
%(iname)
s and
%(oname)
s for the input and output C
variable names respectively.
variable names respectively.
:param version: A number indicating the version of the code, for cache.
:param version: A number indicating the version of the code, for cache.
...
@@ -396,7 +396,7 @@ def register_shape_i_c_code(typ, code, version=()):
...
@@ -396,7 +396,7 @@ def register_shape_i_c_code(typ, code, version=()):
:param typ: A Theano type. It must be the Theano class itself and not an
:param typ: A Theano type. It must be the Theano class itself and not an
instance of the class.
instance of the class.
:param code: C code that get the shape of dimensions
%(i)
s for the Theano type 'typ'.
:param code: C code that get
s
the shape of dimensions
%(i)
s for the Theano type 'typ'.
Use
%(iname)
s and
%(oname)
s for the input and output C
Use
%(iname)
s and
%(oname)
s for the input and output C
variable names respectively.
variable names respectively.
:param version: A number indicating the version of the code, for cache.
:param version: A number indicating the version of the code, for cache.
...
@@ -508,11 +508,11 @@ def register_rebroadcast_c_code(typ, code, version=()):
...
@@ -508,11 +508,11 @@ def register_rebroadcast_c_code(typ, code, version=()):
:param typ: A Theano type. It must be the Theano class itself and not an
:param typ: A Theano type. It must be the Theano class itself and not an
instance of the class.
instance of the class.
:param code: C code that check
if the dimensions
%(axis)
is of
:param code: C code that check
s if the dimension
%(axis)
s
is of
shape 1 for the Theano type 'typ'. Use
%(iname)
s and
shape 1 for the Theano type 'typ'. Use
%(iname)
s and
%(oname)
s for the input and output C variable names
%(oname)
s for the input and output C variable names
respectively
.
%(axis)
s for the axis that we need to
respectively
, and
%(axis)
s for the axis that we need to
check. This code is put in a loop for all ax
is
check. This code is put in a loop for all ax
es.
:param version: A number indicating the version of the code, for cache.
:param version: A number indicating the version of the code, for cache.
"""
"""
...
@@ -546,14 +546,13 @@ class Rebroadcast(gof.Op):
...
@@ -546,14 +546,13 @@ class Rebroadcast(gof.Op):
self
.
axis
=
dict
(
axis
)
self
.
axis
=
dict
(
axis
)
for
axis
,
broad
in
self
.
axis
.
iteritems
():
for
axis
,
broad
in
self
.
axis
.
iteritems
():
assert
isinstance
(
axis
,
(
numpy
.
integer
,
int
)),
(
assert
isinstance
(
axis
,
(
numpy
.
integer
,
int
)),
(
"Rebroadcast need
integers axi
s. Got "
,
axis
)
"Rebroadcast need
s integer axe
s. Got "
,
axis
)
def
__eq__
(
self
,
other
):
def
__eq__
(
self
,
other
):
return
type
(
self
)
==
type
(
other
)
and
self
.
axis
==
other
.
axis
return
type
(
self
)
==
type
(
other
)
and
self
.
axis
==
other
.
axis
def
__hash__
(
self
):
def
__hash__
(
self
):
items
=
self
.
axis
.
items
()
items
=
sorted
(
self
.
axis
.
iteritems
())
# no ambiguity because each item key is unique
items
.
sort
()
# no ambiguity because each item key is unique
return
hash
(
type
(
self
))
^
hash
(
tuple
(
items
))
return
hash
(
type
(
self
))
^
hash
(
tuple
(
items
))
def
__str__
(
self
):
def
__str__
(
self
):
...
@@ -654,7 +653,7 @@ def register_specify_shape_c_code(typ, code, version=(),
...
@@ -654,7 +653,7 @@ def register_specify_shape_c_code(typ, code, version=(),
:param typ: A Theano type. It must be the Theano class itself and not an
:param typ: A Theano type. It must be the Theano class itself and not an
instance of the class.
instance of the class.
:param code: C code that check
the shape and return
a view for the Theano type 'typ'.
:param code: C code that check
s the shape and returns
a view for the Theano type 'typ'.
Use
%(iname)
s and
%(oname)
s for the input and output C
Use
%(iname)
s and
%(oname)
s for the input and output C
variable names respectively.
variable names respectively.
%(shape)
s is the vector of shape of
%(iname)
s.
%(shape)
s is the vector of shape of
%(iname)
s.
...
...
theano/sparse/basic.py
浏览文件 @
58868b92
...
@@ -693,7 +693,7 @@ CSC = CSM('csc')
...
@@ -693,7 +693,7 @@ CSC = CSM('csc')
representation.
representation.
:param data: One dimensional tensor representing
:param data: One dimensional tensor representing
the data of the sparse to construct.
the data of the sparse
matrix
to construct.
:param indices: One dimensional tensor of integers
:param indices: One dimensional tensor of integers
representing the indices of the sparse
representing the indices of the sparse
matrix to construct.
matrix to construct.
...
@@ -716,7 +716,7 @@ CSR = CSM('csr')
...
@@ -716,7 +716,7 @@ CSR = CSM('csr')
representation.
representation.
:param data: One dimensional tensor representing
:param data: One dimensional tensor representing
the data of the sparse to construct.
the data of the sparse
matrix
to construct.
:param indices: One dimensional tensor of integers
:param indices: One dimensional tensor of integers
representing the indices of the sparse
representing the indices of the sparse
matrix to construct.
matrix to construct.
...
@@ -1096,18 +1096,18 @@ class GetItem2d(gof.op.Op):
...
@@ -1096,18 +1096,18 @@ class GetItem2d(gof.op.Op):
return
self
.
__class__
.
__name__
return
self
.
__class__
.
__name__
get_item_2d
=
GetItem2d
()
get_item_2d
=
GetItem2d
()
"""Implement a subtensor of sparse variable
and that return
a
"""Implement a subtensor of sparse variable
, returning
a
sparse matrix.
sparse matrix.
If you want to take only one element of a sparse matrix see
If you want to take only one element of a sparse matrix see
`GetItemScalar` that return a tensor scalar.
`GetItemScalar` that return
s
a tensor scalar.
.. note::
.. note::
Subtensor selection always returns a matrix, so indexing
Subtensor selection always returns a matrix, so indexing
with [a:b, c:d] is forced. If one index is a scalar
. F
or
with [a:b, c:d] is forced. If one index is a scalar
, f
or
instance, x[a:b, c]
and x[a, b:c], generate an error
. Use
instance, x[a:b, c]
or x[a, b:c], an error will be raised
. Use
instead x[a:b, c:c+1]
and
x[a:a+1, b:c].
instead x[a:b, c:c+1]
or
x[a:a+1, b:c].
The above indexing methods are not supported because the return value
The above indexing methods are not supported because the return value
would be a sparse matrix rather than a sparse vector, which is a
would be a sparse matrix rather than a sparse vector, which is a
...
@@ -1118,7 +1118,7 @@ when sparse vectors are supported.
...
@@ -1118,7 +1118,7 @@ when sparse vectors are supported.
:param x: Sparse matrix.
:param x: Sparse matrix.
:param index: Tuple of slice object.
:param index: Tuple of slice object.
:return: The
slice corresponding
in `x`.
:return: The
corresponding slice
in `x`.
:note: The grad is not implemented for this op.
:note: The grad is not implemented for this op.
"""
"""
...
@@ -1168,8 +1168,8 @@ class GetItemScalar(gof.op.Op):
...
@@ -1168,8 +1168,8 @@ class GetItemScalar(gof.op.Op):
return
self
.
__class__
.
__name__
return
self
.
__class__
.
__name__
get_item_scalar
=
GetItemScalar
()
get_item_scalar
=
GetItemScalar
()
"""Implement a subtensor of a sparse variable that take
"""Implement a subtensor of a sparse variable that take
s
two scalars as index and return a scalar.
two scalars as index and return
s
a scalar.
If you want to take a slice of a sparse matrix see
If you want to take a slice of a sparse matrix see
`GetItem2d` that returns a sparse matrix.
`GetItem2d` that returns a sparse matrix.
...
@@ -1177,7 +1177,7 @@ If you want to take a slice of a sparse matrix see
...
@@ -1177,7 +1177,7 @@ If you want to take a slice of a sparse matrix see
:param x: Sparse matrix.
:param x: Sparse matrix.
:param index: Tuple of scalars.
:param index: Tuple of scalars.
:return: The
item corresponding
in `x`.
:return: The
corresponding item
in `x`.
:note: The grad is not implemented for this op.
:note: The grad is not implemented for this op.
"""
"""
...
@@ -1498,14 +1498,14 @@ class SpSum(gof.op.Op):
...
@@ -1498,14 +1498,14 @@ class SpSum(gof.op.Op):
def
sp_sum
(
x
,
axis
=
None
,
sparse_grad
=
False
):
def
sp_sum
(
x
,
axis
=
None
,
sparse_grad
=
False
):
"""Calculate the sum of a sparse matrix along
a specify
"""Calculate the sum of a sparse matrix along
the specified
axis.
axis.
It operates a reduction along the
axis specified
. When
It operates a reduction along the
specified axis
. When
`axis` is `None`, it is appl
y
along all axes.
`axis` is `None`, it is appl
ied
along all axes.
:param x: Sparse matrix.
:param x: Sparse matrix.
:param axis: Axis along which the sum is applied. Integer
s
or `None`.
:param axis: Axis along which the sum is applied. Integer or `None`.
:param sparse_grad: `True` to have a structured grad. Boolean.
:param sparse_grad: `True` to have a structured grad. Boolean.
:return: The sum of `x` in a dense format.
:return: The sum of `x` in a dense format.
...
@@ -1645,7 +1645,7 @@ class EnsureSortedIndices(gof.op.Op):
...
@@ -1645,7 +1645,7 @@ class EnsureSortedIndices(gof.op.Op):
else
:
else
:
return
self
.
__class__
.
__name__
+
"{no_inplace}"
return
self
.
__class__
.
__name__
+
"{no_inplace}"
ensure_sorted_indices
=
EnsureSortedIndices
(
inplace
=
False
)
ensure_sorted_indices
=
EnsureSortedIndices
(
inplace
=
False
)
"""Resort indices of a sparse matrix.
"""Re
-
sort indices of a sparse matrix.
CSR column indices are not necessarily sorted. Likewise
CSR column indices are not necessarily sorted. Likewise
for CSC row indices. Use `ensure_sorted_indices` when sorted
for CSC row indices. Use `ensure_sorted_indices` when sorted
...
@@ -1662,12 +1662,12 @@ libraries).
...
@@ -1662,12 +1662,12 @@ libraries).
def
clean
(
x
):
def
clean
(
x
):
"""Remove explicit zeros from a sparse matrix, and
"""Remove explicit zeros from a sparse matrix, and
resort indices.
re
-
sort indices.
CSR column indices are not necessarily sorted. Likewise
CSR column indices are not necessarily sorted. Likewise
for CSC row indices. Use `clean` when sorted
for CSC row indices. Use `clean` when sorted
indices are required (e.g. when passing data to other
indices are required (e.g. when passing data to other
libraries) and to ensure there
is
no zeros in the data.
libraries) and to ensure there
are
no zeros in the data.
:param x: A sparse matrix.
:param x: A sparse matrix.
...
@@ -1860,9 +1860,9 @@ class StructuredAddSV(gof.op.Op):
...
@@ -1860,9 +1860,9 @@ class StructuredAddSV(gof.op.Op):
return
self
.
__class__
.
__name__
return
self
.
__class__
.
__name__
structured_add_s_v
=
StructuredAddSV
()
structured_add_s_v
=
StructuredAddSV
()
"""Structured addition of a sparse matrix and a dense vector.
"""Structured addition of a sparse matrix and a dense vector.
The elements of the vector are
are
only added to the corresponding
The elements of the vector are only added to the corresponding
non-zero elements
. Therefore, this operation outputs another sparse
non-zero elements
of the sparse matrix. Therefore, this operation
matrix.
outputs another sparse
matrix.
:param x: Sparse matrix.
:param x: Sparse matrix.
:param y: Tensor type vector.
:param y: Tensor type vector.
...
@@ -3696,7 +3696,7 @@ class Usmm(gof.op.Op):
...
@@ -3696,7 +3696,7 @@ class Usmm(gof.op.Op):
out
[
0
]
=
rval
out
[
0
]
=
rval
usmm
=
Usmm
()
usmm
=
Usmm
()
"""Performs the expression
is
`alpha` * `x` `y` + `z`.
"""Performs the expression `alpha` * `x` `y` + `z`.
:param x: Matrix variable.
:param x: Matrix variable.
:param y: Matrix variable.
:param y: Matrix variable.
...
...
theano/tensor/basic.py
浏览文件 @
58868b92
...
@@ -3151,7 +3151,7 @@ class Split(Op):
...
@@ -3151,7 +3151,7 @@ class Split(Op):
raise
ValueError
(
'The splits sum to
%
s, expected
%
s'
%
raise
ValueError
(
'The splits sum to
%
s, expected
%
s'
%
(
numpy
.
sum
(
splits
),
len_along_axis
))
(
numpy
.
sum
(
splits
),
len_along_axis
))
if
python_any
([
nb
<
0
for
nb
in
splits
]):
if
python_any
([
nb
<
0
for
nb
in
splits
]):
raise
ValueError
(
'Split: you tr
y to make an ndarray with
'
raise
ValueError
(
'Split: you tr
ied to make an ndarray with a
'
'negative number of elements.'
)
'negative number of elements.'
)
# Checking is done, let's roll the splitting algorithm!
# Checking is done, let's roll the splitting algorithm!
...
...
theano/tensor/signal/conv.py
浏览文件 @
58868b92
...
@@ -88,7 +88,7 @@ def conv2d(input, filters, image_shape=None, filter_shape=None,
...
@@ -88,7 +88,7 @@ def conv2d(input, filters, image_shape=None, filter_shape=None,
if
input
.
ndim
==
2
and
filters
.
ndim
==
2
:
if
input
.
ndim
==
2
and
filters
.
ndim
==
2
:
if
theano
.
config
.
warn
.
signal_conv2d_interface
:
if
theano
.
config
.
warn
.
signal_conv2d_interface
:
warnings
.
warn
(
warnings
.
warn
(
"theano.tensor.signal.conv2d() now output 2d tensor when both"
"theano.tensor.signal.conv2d() now output
s a
2d tensor when both"
" inputs are 2d. To disable this warning, set the Theano flag"
" inputs are 2d. To disable this warning, set the Theano flag"
" warn.signal_conv2d_interface to False"
,
" warn.signal_conv2d_interface to False"
,
stacklevel
=
3
)
stacklevel
=
3
)
...
...
theano/typed_list/basic.py
浏览文件 @
58868b92
...
@@ -101,7 +101,7 @@ getitem = GetItem()
...
@@ -101,7 +101,7 @@ getitem = GetItem()
"""
"""
Get specified slice of a typed list.
Get specified slice of a typed list.
:param x: type
type
list.
:param x: type
d
list.
:param index: the index of the value to return from `x`.
:param index: the index of the value to return from `x`.
"""
"""
...
@@ -227,7 +227,7 @@ class Extend(Op):
...
@@ -227,7 +227,7 @@ class Extend(Op):
extend
=
Extend
()
extend
=
Extend
()
"""
"""
Append all element of a list at the end of another list.
Append all element
s
of a list at the end of another list.
:param x: The typed list to extend.
:param x: The typed list to extend.
:param toAppend: The typed list that will be added at the end of `x`.
:param toAppend: The typed list that will be added at the end of `x`.
...
@@ -296,7 +296,7 @@ insert = Insert()
...
@@ -296,7 +296,7 @@ insert = Insert()
"""
"""
Insert an element at an index in a typed list.
Insert an element at an index in a typed list.
:param x: the typed list to modif
ied
.
:param x: the typed list to modif
y
.
:param index: the index where to put the new element in `x`.
:param index: the index where to put the new element in `x`.
:param toInsert: The new element to insert.
:param toInsert: The new element to insert.
"""
"""
...
@@ -475,11 +475,11 @@ class Count(Op):
...
@@ -475,11 +475,11 @@ class Count(Op):
count
=
Count
()
count
=
Count
()
"""
"""
Count the number of time an element is in the typed list.
Count the number of time
s
an element is in the typed list.
:param x: The typed list to look into.
:param x: The typed list to look into.
:param elem: The element we want to count in list.
:param elem: The element we want to count in list.
The element are compared with equals.
The element
s
are compared with equals.
:note: Python implementation of count doesn't work when we want to
:note: Python implementation of count doesn't work when we want to
count an ndarray from a list. This implementation works in that
count an ndarray from a list. This implementation works in that
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论