-
Notifications
You must be signed in to change notification settings - Fork 765
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
54 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
.. _cn_api_paddle_linalg_matrix_exp: | ||
|
||
matrix_exp | ||
------------------------------- | ||
|
||
.. py:function:: paddle.linalg.matrix_exp(x, name=None) | ||
计算方阵的矩阵指数。 | ||
|
||
.. math:: | ||
exp(A) = \sum_{n=0}^\infty A^n/n! | ||
输入的张量 ``x`` 应该是方阵,比如 ``(*, M, M)`` ,矩阵指数通过比例平方法的帕德近似计算而来。 | ||
|
||
[1] Nicholas J. Higham, The scaling and squaring method for the matrix exponential revisited. | ||
|
||
|
||
参数 | ||
:::::::::::: | ||
|
||
- **x** (Tensor) - 输入张量,形状应该为 ``(*, M, M)`` , ``*`` 表示 0 或多个维度。数据类型为: ``float32``, ``float64`` 。 | ||
- **name** (str,可选) - 具体用法请参见 :ref:`api_guide_Name`,一般无需设置,默认值为 None。 | ||
|
||
返回 | ||
:::::::::::: | ||
Tensor,与 ``x`` 的类型和形状相同。 | ||
|
||
代码示例 | ||
:::::::::: | ||
|
||
COPY-FROM: paddle.linalg.matrix_exp |
20 changes: 20 additions & 0 deletions
20
...l_convert/convert_from_pytorch/api_difference/linalg/torch.linalg.matrix_exp.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
## [ 仅参数名不一致 ]torch.linalg.matrix_exp | ||
### [torch.linalg.matrix_power](https://pytorch.org/docs/stable/generated/torch.linalg.matrix_exp.html#torch.linalg.matrix_exp) | ||
|
||
```python | ||
torch.linalg.matrix_exp(A) | ||
``` | ||
|
||
### [paddle.linalg.matrix_exp](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/linalg/matrix_exp_cn.html) | ||
|
||
```python | ||
paddle.linalg.matrix_exp(x, name=None) | ||
``` | ||
|
||
Pytorch 相比 Paddle 仅参数名不一致,具体如下: | ||
|
||
### 参数映射 | ||
|
||
| PyTorch | PaddlePaddle | 备注 | | ||
| ------------- | ------------ | ------------------------------------------------------ | | ||
| A | x | 输入的方阵,类型为 Tensor,仅参数名不一致。 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters