Multiply several matrices in numpy

前端 未结 5 2233
借酒劲吻你
借酒劲吻你 2021-02-02 06:52

Suppose you have n square matrices A1,...,An. Is there anyway to multiply these matrices in a neat way? As far as I know dot in numpy accepts only two arguments. One obvious way

5条回答
  •  眼角桃花
    2021-02-02 07:06

    If you compute all the matrices a priori then you should use an optimization scheme for matrix chain multiplication. See this Wikipedia article.

提交回复
热议问题