element-wise product = element-wise multiplication = Hadamard product
含义:两个矩阵对应位置元素进行乘积
import numpy as np
# 2-D array: 2 x 3
x1 = np.array([[1, 2, 3], [4, 5, 6]])
print(x1)
x2 = np.array([[7, 8, 9], [4, 7, 1]])
print(x2)
# 对应元素相乘 element-wise product
y1 = x1 * x2
print('element wise product: ')
print('%s' % (y1))
# 对应元素相乘 element-wise product
y2 = np.multiply(x1, x2)
print('element wise product: ')
print('%s' % (y2))
参考自:
element-wise product 和 element-wise multiplication? - 知乎
Python中的几种矩阵乘法(小结) - 三水点靠木