public static double cosineSim(@NonNull INDArray d1, @NonNull INDArray d2) {
    """
	Cosine similarity
	
	@param d1 the first vector
	@param d2 the second vector
	@return the cosine similarities between the 2 arrays
    """
        return Nd4j.getExecutioner().execAndReturn(new CosineSimilarity(d1, d2, d1.length())).getFinalResult()
                        .doubleValue();
    }
public static double cosineSim(@NonNull INDArray d1, @NonNull INDArray d2) {
        return Nd4j.getExecutioner().execAndReturn(new CosineSimilarity(d1, d2, d1.length())).getFinalResult()
                        .doubleValue();
    }
public static double cosineSim ( @ NonNull INDArray d1 , @ NonNull INDArray d2 ) { return Nd4j . getExecutioner ( ) . execAndReturn ( new CosineSimilarity ( d1 , d2 , d1 . length ( ) ) ) . getFinalResult ( ) . doubleValue ( ) ; }
Cosine similarity

@param d1 the first vector
@param d2 the second vector
@return the cosine similarities between the 2 arrays
Cosine similarity