logo

openmv中可以进行矩阵乘法吗

2022-05-16 15:52
7
zinq
d97b3c86-e909-45b6-9437-9c7b2e7cf038.png
2022-05-16 20:51
I
网红小智智 星瞳科技

https://book.openmv.cc/example/04-Image-Filters/ulab.html

点乘用dot

https://micropython-ulab.readthedocs.io/en/latest/numpy-functions.html#dot

2022-05-18 01:49
7
zinq

用了dot还是找不到这个module

1e191cce-2b2b-4de2-9ec1-9d9f6a78040f.png
2022-05-18 21:03
I
网红小智智 星瞳科技

你的matmul没删干净

下面的代码是可以运行的。

from ulab import numpy as np

m = np.array([[1, 2, 3], [4, 5, 6], [7, 10, 9]], dtype=np.uint8)
n = np.linalg.inv(m)
print("m:\n", m)
print("\nm^-1:\n", n)
# this should be the unit matrix
print("\nm*m^-1:\n", np.dot(m, n))