private void normalizeWeights() {
   weights.setMainDiagonal(0);
   weights.divide(weights.maximum());
   weights.setMainDiagonal(1);
 }