torch.vander#
- torch.vander(x, N=None, increasing=False) Tensor#
生成 Vandermonde 矩阵。
输出矩阵的列是输入向量的逐元素幂 . If increasing is True, the order of the columns is reversed . 这种每一行都包含几何级数的矩阵是以 Alexandre-Theophile Vandermonde 的名字命名的。
- 参数
- 返回
Vandermonde 矩阵。如果 increasing 为 False,则第一列是 ,第二列是 ,以此类推。如果 increasing 为 True,则列为 。
- 返回类型
示例
>>> x = torch.tensor([1, 2, 3, 5]) >>> torch.vander(x) tensor([[ 1, 1, 1, 1], [ 8, 4, 2, 1], [ 27, 9, 3, 1], [125, 25, 5, 1]]) >>> torch.vander(x, N=3) tensor([[ 1, 1, 1], [ 4, 2, 1], [ 9, 3, 1], [25, 5, 1]]) >>> torch.vander(x, N=3, increasing=True) tensor([[ 1, 1, 1], [ 1, 2, 4], [ 1, 3, 9], [ 1, 5, 25]])