Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
84c355e3
提交
84c355e3
authored
6月 18, 2014
作者:
Olivier Delalleau
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
More typo fixes
上级
f1038c21
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
27 行增加
和
27 行删除
+27
-27
basic.py
theano/sparse/basic.py
+22
-22
basic.py
theano/typed_list/basic.py
+5
-5
没有找到文件。
theano/sparse/basic.py
浏览文件 @
84c355e3
...
@@ -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 specif
y
"""Calculate the sum of a sparse matrix along a specif
ic
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/typed_list/basic.py
浏览文件 @
84c355e3
...
@@ -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
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论