Change gradient from max to zero for duplicate points
@@ -176,7 +176,7 @@ def _optimize_layout_euclidean_single_epoch(
if grad_coeff > 0.0:
grad_d = clip(grad_coeff * (current[d] - other[d]))
else:
- grad_d = 4.0
+ grad_d = 0
current[d] += grad_d * alpha
epoch_of_next_negative_sample[i] += (
@@ -972,7 +972,7 @@ def _optimize_layout_aligned_euclidean_single_epoch(
if grad_coeff > 0.0:
grad_d = clip(grad_coeff * (current[d] - other[d]))
else:
- grad_d = 4.0
+ grad_d = 0.0
for offset in range(-window_size, window_size):
neighbor_m = m + offset
