欢迎访问yhm138的博客园博客, 你可以通过 [RSS] 的方式持续关注博客更新

MyAvatar

yhm138

HelloWorld!

矩阵的各种乘法

dot product以及他的generalizations


(*mma*)
Dot[{1, 2, 3}, {4, 5, 6}]

这是矩阵乘法Matrix multiplication

[1,1,1;2,2,2]*[1,2,3].'   %matlab中的例子
(*mma*)
{{1, 1, 1}, {2, 2, 2}}.Transpose@{{1, 2, 3}, {4, 5, 6}}

这是外积

also called dyadic product or tensor product of two column matrices

一般来说,外积的结果是一个秩1矩阵。

这是Frobenius inner product

这是Cracovian product

\[\text { Cracovian product, defined as } \mathbf{A} \wedge \mathbf{B}=\mathbf{B}^{\mathrm{T}} \mathbf{A} \]

这是Hadamard Product,和MATLAB里的.*很像

%matlab中直接这么写
[1,1,1;2,2,2].*[2,2,2;3,3,3]
(*mma*)
Times[{{1, 1, 1}, {2, 2, 2}}, {{2, 2, 2}, {3, 3, 3}}]

这是Kronecker product,张量积

% matlab中直接这么写
kron(A, B)

先分块,然后Kronecker 积,这是一种新积

先分列,然后Kronecker 积,这是一种新积

先分行,然后Kronecker 积,这是一种新积

broadcasting会写吗

https://www.jianshu.com/p/550c90dfffa0

posted @ 2021-02-06 20:46  yhm138  阅读(637)  评论(0编辑  收藏  举报