12 Star 55 Fork 41

MindSpore / graphlearning

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
mindspore_gl.graph.get_laplacian.rst 1.35 KB
一键复制 编辑 原始数据 按行查看 历史
luojianing 提交于 2023-04-19 16:30 . add ` for values in docs

mindspore_gl.graph.get_laplacian

.. py:function:: mindspore_gl.graph.get_laplacian(edge_index, num_nodes, edge_weight=None, normalization='sym')

    获得laplacian矩阵。

    参数:
         - **edge_index** (Tensor) - 边索引。shape为 :math:`(2, N\_e)` 其中 :math:`N\_e` 是边的数量。
         - **num_nodes** (int) - 节点数。
         - **edge_weight** (Tensor, 可选) - 边权重。shape为 :math:`(N\_e)` 其中 :math:`N\_e` 是边的数量。默认值:``None``。
         - **normalization** (str, 可选) - 归一化方法。默认值: ``'sym'``。

           :math:`(L)` 为归一化的矩阵, :math:`(D)` 为度矩阵, :math:`(A)` 为邻接矩阵, :math:`(I)` 为单元矩阵。

           1. `None` :无
              :math:`\mathbf{L} = \mathbf{D} - \mathbf{A}`

           2. `'sym'` :对称归一化
              :math:`\mathbf{L} = \mathbf{I} - \mathbf{D}^{-1/2} \mathbf{A} \mathbf{D}^{-1/2}`

           3. `'rw'` :随机游走归一化
              :math:`\mathbf{L} = \mathbf{I} - \mathbf{D}^{-1} \mathbf{A}`

    返回:
         - **edge_index** (Tensor) - 标准化的边索引。
         - **edge_weight** (Tensor) - 归一化边权重。

    异常:
        - **ValueError** - 如果 `normalization` 不是 ``None``、``'sym'`` 或 ``'rw'``。
1
https://gitee.com/mindspore/graphlearning.git
git@gitee.com:mindspore/graphlearning.git
mindspore
graphlearning
graphlearning
master

搜索帮助