Why is np.linalg.norm(…, axis=1) slower than writing out the formula for vector norms?

前端 未结 0 1367
时光说笑
时光说笑 2020-11-22 05:44

To normalize the rows of a matrix X to unit length, I usually proceed as follows:

X /= np.linalg.norm(X, axis=1, keepdims=True)

相关标签:
回答
  • 消灭零回复
提交回复
热议问题