public void calcDistancesRelativeTo(INDArray items, INDArray basePoint, INDArray distancesArr) {
        switch (similarityFunction) {
            case "euclidean":
                Nd4j.getExecutioner().exec(new EuclideanDistance(items, basePoint, distancesArr, true,-1));
                break;
            case "cosinedistance":
                Nd4j.getExecutioner().exec(new CosineDistance(items, basePoint, distancesArr, true, -1));
                break;
            case "cosinesimilarity":
                Nd4j.getExecutioner().exec(new CosineSimilarity(items, basePoint, distancesArr, true, -1));
                break;
            case "manhattan":
                Nd4j.getExecutioner().exec(new ManhattanDistance(items, basePoint, distancesArr, true, -1));
                break;
            case "dot":
                Nd4j.getExecutioner().exec(new Dot(items, basePoint, distancesArr, -1));
                break;
            case "jaccard":
                Nd4j.getExecutioner().exec(new JaccardDistance(items, basePoint, distancesArr, true, -1));
                break;
            case "hamming":
                Nd4j.getExecutioner().exec(new HammingDistance(items, basePoint, distancesArr, true, -1));
                break;
            default:
                Nd4j.getExecutioner().exec(new EuclideanDistance(items, basePoint, distancesArr, true, -1));
                break;

        }

        if (invert)
            distancesArr.negi();

    }
public void calcDistancesRelativeTo ( INDArray items , INDArray basePoint , INDArray distancesArr ) { switch ( similarityFunction ) { case "euclidean" : Nd4j . getExecutioner ( ) . exec ( new EuclideanDistance ( items , basePoint , distancesArr , true , - 1 ) ) ; break ; case "cosinedistance" : Nd4j . getExecutioner ( ) . exec ( new CosineDistance ( items , basePoint , distancesArr , true , - 1 ) ) ; break ; case "cosinesimilarity" : Nd4j . getExecutioner ( ) . exec ( new CosineSimilarity ( items , basePoint , distancesArr , true , - 1 ) ) ; break ; case "manhattan" : Nd4j . getExecutioner ( ) . exec ( new ManhattanDistance ( items , basePoint , distancesArr , true , - 1 ) ) ; break ; case "dot" : Nd4j . getExecutioner ( ) . exec ( new Dot ( items , basePoint , distancesArr , - 1 ) ) ; break ; case "jaccard" : Nd4j . getExecutioner ( ) . exec ( new JaccardDistance ( items , basePoint , distancesArr , true , - 1 ) ) ; break ; case "hamming" : Nd4j . getExecutioner ( ) . exec ( new HammingDistance ( items , basePoint , distancesArr , true , - 1 ) ) ; break ; default : Nd4j . getExecutioner ( ) . exec ( new EuclideanDistance ( items , basePoint , distancesArr , true , - 1 ) ) ; break ; } if ( invert ) distancesArr . negi ( ) ; }
@param basePoint
@param distancesArr