Commit decc31d
committed
Apply degree normalization to property part of initial random vectors
A seemingly strange/buggy behavior was reported.
Somewhat simplified, it was expected that when
nodeSelfInfluence > 0 and propertyRatio is high (0.8),
that among (n1: {val: [0.1, 1.0]}), (n2: {val: [0.1, 1.0]}) and (n3: {val: [0.2, 1.0]},
it should "often" hold that SIM(emb(n1), emb(n2)) > SIM(emb(n1), emb(n3).
Whether this expectation is reasonable is out of the scope of this commit, but
to partly remedy this, something else was discovered and fixed:
The initial random vector is split into two segments corresponding to
embeddingDimension = baseEmbeddingDimension + propertyDimension.
The the first segment, entries were scaled by the degree of the node to the power of
`normalizationStrength`, however, the second segment of length propertyDimension was
not scaled by this scaling factor.
The current commit applies the scaling also to the second segment.
This removes the effect of reduced influence of entries in the second segment, that is
reduced node property influence, when normalizationStrength > 0 and deg(n) > 1.1 parent d623614 commit decc31d
File tree
1 file changed
+9
-4
lines changed- algo/src/main/java/org/neo4j/gds/embeddings/fastrp
1 file changed
+9
-4
lines changedLines changed: 9 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
344 | 344 | | |
345 | 345 | | |
346 | 346 | | |
347 | | - | |
| 347 | + | |
348 | 348 | | |
349 | 349 | | |
350 | 350 | | |
351 | 351 | | |
352 | 352 | | |
353 | 353 | | |
354 | | - | |
| 354 | + | |
355 | 355 | | |
356 | 356 | | |
357 | 357 | | |
358 | 358 | | |
359 | 359 | | |
360 | 360 | | |
| 361 | + | |
361 | 362 | | |
362 | 363 | | |
363 | 364 | | |
364 | 365 | | |
365 | 366 | | |
366 | 367 | | |
367 | 368 | | |
| 369 | + | |
368 | 370 | | |
369 | 371 | | |
370 | 372 | | |
371 | 373 | | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
372 | 377 | | |
373 | 378 | | |
374 | 379 | | |
375 | 380 | | |
376 | 381 | | |
377 | | - | |
| 382 | + | |
378 | 383 | | |
379 | 384 | | |
380 | 385 | | |
| |||
384 | 389 | | |
385 | 390 | | |
386 | 391 | | |
387 | | - | |
| 392 | + | |
388 | 393 | | |
389 | 394 | | |
390 | 395 | | |
| |||
0 commit comments