Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
c2dce21c
提交
c2dce21c
authored
6月 13, 2014
作者:
Frederic
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Only doc user function, not the class.
上级
809e4e2c
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
40 行增加
和
41 行删除
+40
-41
index.txt
doc/library/sparse/index.txt
+22
-24
basic.py
theano/sparse/basic.py
+18
-17
没有找到文件。
doc/library/sparse/index.txt
浏览文件 @
c2dce21c
...
...
@@ -119,16 +119,18 @@ List of Implemented Operations
==============================
- Moving from and to sparse
- :
class:`DenseFromSparse <theano.sparse.basic.DenseFromSparse>` and ``dense_from_sparse`
`.
- :
func:`dense_from_sparse <theano.sparse.basic.dense_from_sparse>
`.
Both grads are implemented. Structured by default.
- :class:`SparseFromDense <theano.sparse.basic.SparseFromDense>` and ``csr_from_dense``, ``csc_from_dense``.
- :func:`csr_from_dense <theano.sparse.basic.csr_from_dense>`,
:func:`csc_from_dense <theano.sparse.basic.csc_from_dense>`.
The grad implemented is structured.
- Theano SparseVariable object have a method ``toarray()`` that is the same as ``dense_from_sparse``.
- Theano SparseVariable object have a method ``toarray()`` that is the same as
:func:`dense_from_sparse <theano.sparse.basic.dense_from_sparse>`.
- Construction of Sparses and their Properties
- :class:`CSM <theano.sparse.basic.CSM>` and ``CSC``, ``CSR`` to construct a matrix.
The grad implemented is regular.
- :
class:`CSMProperties <theano.sparse.basic.CSMProperties>` and ``csm_properties(x)``
- :
func:`csm_properties <theano.sparse.basic.csm_properties>`.
to get the properties of a sparse matrix.
The grad implemented is regular.
- csm_indices(x), csm_indptr(x), csm_data(x) and csm_shape(x) or x.shape.
...
...
@@ -136,22 +138,22 @@ List of Implemented Operations
The grad implemented is regular.
- :func:`sp_zeros_like <theano.sparse.basic.sp_zeros_like>`.
The grad implemented is regular.
- :
class:`SquareDiagonal <theano.sparse.basic.SquareDiagonal>` and ``square_diagonal`
`.
- :
func:`square_diagonal <theano.sparse.basic.square_diagonal>
`.
The grad implemented is regular.
- :
class:`ConstructSparseFromList <theano.sparse.basic.ConstructSparseFromList>` and ``construct_sparse_from_list`
`.
- :
func:`construct_sparse_from_list <theano.sparse.basic.construct_sparse_from_list>
`.
The grad implemented is regular.
- Cast
- :
class:`Cast <theano.sparse.basic.C
ast>` with ``bcast``, ``wcast``, ``icast``, ``lcast``,
- :
func:`cast <theano.sparse.basic.c
ast>` with ``bcast``, ``wcast``, ``icast``, ``lcast``,
``fcast``, ``dcast``, ``ccast``, and ``zcast``.
The grad implemented is regular.
- Transpose
- :
class:`Transpose <theano.sparse.basic.Transpose>` and ``transpose`
`.
- :
func:`Transpose <theano.sparse.basic.transpose>
`.
The grad implemented is regular.
- Basic Arithmetic
- :
class:`Neg <theano.sparse.basic.N
eg>`.
- :
func:`neg <theano.sparse.basic.n
eg>`.
The grad implemented is regular.
- :func:`eq <theano.sparse.basic.eq>`.
- :func:`neq <theano.sparse.basic.neq>`.
...
...
@@ -201,15 +203,13 @@ List of Implemented Operations
- ``sqrt``
- Dot Product
- :class:`Dot <theano.sparse.basic.Dot>` and
:func:`dot <theano.sparse.basic.dot>`.
- :func:`dot <theano.sparse.basic.dot>`.
- One of the inputs must be sparse, the other sparse or dense.
- The grad implemented is regular.
- No C code for perform and no C code for grad.
- Returns a dense for perform and a dense for grad.
- :class:`StructuredDot <theano.sparse.basic.StructuredDot>`
and :func:`structured_dot <theano.sparse.basic.structured_dot>`.
- :func:`structured_dot <theano.sparse.basic.structured_dot>`.
- The first input is sparse, the second can be sparse or dense.
- The grad implemented is structured.
...
...
@@ -218,8 +218,7 @@ List of Implemented Operations
dense one if one of the inputs is dense.
- Returns a sparse grad for sparse inputs and dense grad for
dense inputs.
- :class:`TrueDot <theano.sparse.basic.TrueDot>` and
:func:`true_dot <theano.sparse.basic.true_dot>`.
- :func:`true_dot <theano.sparse.basic.true_dot>`.
- The first input is sparse, the second can be sparse or dense.
- The grad implemented is regular.
...
...
@@ -229,19 +228,18 @@ List of Implemented Operations
default a dense for dense inputs. The parameter
``grad_preserves_dense`` can be set to False to return a
sparse grad for dense inputs.
- :class:`SamplingDot <theano.sparse.basic.SamplingDot>` and
``sampling_dot``.
- :func:`sampling_dot <theano.sparse.basic.sampling_dot>`.
- Both inputs must be dense.
- The grad implemented is structured for `p`.
- Sample of the dot and sample of the gradient.
- C code for perform but not for grad.
- Returns sparse for perform and grad.
- :
class:`Usmm <theano.sparse.basic.Usmm>` and ``usmm`
`.
- :
func:`usmm <theano.sparse.basic.usmm>
`.
- You *shouldn't* insert this op yourself!
- There is an optimization that transform a
:
class:`Dot <theano.sparse.basic.D
ot>` to ``Usmm`` when possible.
:
func:`dot <theano.sparse.basic.d
ot>` to ``Usmm`` when possible.
- This op is the equivalent of gemm for sparse dot.
- There is no grad implemented for this op.
...
...
@@ -256,13 +254,13 @@ List of Implemented Operations
- Sparse variables don't support [M, N:O] and [M:N, O] as we don't
support sparse vectors and returning a sparse matrix would break
the numpy interface. Use [M:M+1, N:O] and [M:N, O:O+1] instead.
- :
class:`Diag <theano.sparse.basic.Diag>` and ``diag`
`.
- :
func:`diag <theano.sparse.basic.diag>
`.
The grad implemented is regular.
- Concatenation
- :
class:`HStack <theano.sparse.basic.HStack>` and ``hstack`
`.
- :
func:`hstack <theano.sparse.basic.hstack>
`.
The grad implemented is regular.
- :
class:`VStack <theano.sparse.basic.VStack>` and ``vstack`
`.
- :
func:`vstack <theano.sparse.basic.vstack>
`.
The grad implemented is regular.
- Probability
...
...
@@ -276,8 +274,8 @@ List of Implemented Operations
- Internal Representation
`They all have a regular grad implemented.`
- :
class:`EnsureSortedIndices <theano.sparse.basic.EnsureSortedIndices>` and ``ensure_sorted_indices``
- :
class:`Remove0 <theano.sparse.basic.Remove0>` and ``remove0``
- :
func:`ensure_sorted_indices <theano.sparse.basic.ensure_sorted_indices>`.
- :
func:`remove0 <theano.sparse.basic.remove0>`.
- :func:`clean <theano.sparse.basic.clean>` to resort indices and remove zeros
- To help testing
...
...
theano/sparse/basic.py
浏览文件 @
c2dce21c
...
...
@@ -3730,19 +3730,7 @@ def dot(x, y):
class
Usmm
(
gof
.
op
.
Op
):
"""Performs the expression is `alpha` * `x` `y` + `z`.
:param x: Matrix variable.
:param y: Matrix variable.
:param z: Dense matrix.
:param alpha: A tensor scalar.
:return: The dense matrix resulting from `alpha` * `x` `y` + `z`.
:note: The grad is not implemented for this op.
:note: At least one of `x` or `y` must be a sparse matrix.
"""
# See doc in instance of this Op or function after this class definition.
# We don't implement the infer_shape as it is
# inserted by optimization only.
...
...
@@ -3802,13 +3790,22 @@ class Usmm(gof.op.Op):
out
[
0
]
=
rval
usmm
=
Usmm
()
"""Performs the expression is `alpha` * `x` `y` + `z`.
:param x: Matrix variable.
:param y: Matrix variable.
:param z: Dense matrix.
:param alpha: A tensor scalar.
class
ConstructSparseFromList
(
gof
.
Op
):
"""Constructs a sparse matrix out of a list of 2-D matrix rows
:return: The dense matrix resulting from `alpha` * `x` `y` + `z`.
:note: The grad implemented is regular, i.e. not structured.
"""
:note: The grad is not implemented for this op.
:note: At least one of `x` or `y` must be a sparse matrix.
"""
class
ConstructSparseFromList
(
gof
.
Op
):
# See doc in instance of this Op or function after this class definition.
def
__hash__
(
self
):
return
hash
((
type
(
self
)))
...
...
@@ -3898,3 +3895,7 @@ class ConstructSparseFromList(gof.Op):
return
[
gx
,
gy
]
+
[
DisconnectedType
()()]
*
len
(
idx_list
)
construct_sparse_from_list
=
ConstructSparseFromList
()
"""Constructs a sparse matrix out of a list of 2-D matrix rows
:note: The grad implemented is regular, i.e. not structured.
"""
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论