[BUG] matrixVectorOp
in Dbscan::Vertexdeg::Algo
should set bcastAlongRows
as false
#5360
Labels
matrixVectorOp
in Dbscan::Vertexdeg::Algo
should set bcastAlongRows
as false
#5360
Describe the bug
A clear and concise description of what the bug is.
IIUC, in
Dbscan::Vertexdeg::Algo
we hope to apply normalization to the input matrix when using cosine metric. However, in the current implementation (v23.06), withbcastAlongRows = true
passed toraft::linalg::matrixVectorOp
, it actually does something not as we expect, like:Obviously, the columns are mistakenly divided by the l2 norm of each row with same index. We should do it by crossing rows instead of along rows.
Moreover, if the size of rows is smaller than the size of columns, UB occurs because of access to an illegal memory.
BTW, we also cannot restore the input matrix if it becomes
inf
for some elements due to division by zero.Steps/Code to reproduce bug
A simple demonstration:
Expected behavior
I think there are two things:
false
tobcastAlongRows
(line 1 & line 2) would be enough.Environment details (please complete the following information):
Additional context
The text was updated successfully, but these errors were encountered: