Class MathUtils

java.lang.Object
com.hw.langchain.math.utils.MathUtils

public class MathUtils extends Object
Math utils.
Author:
HamaWhite
  • Method Summary

    Modifier and Type
    Method
    Description
    static org.nd4j.linalg.api.ndarray.INDArray
    cosineSimilarity(List<List<Float>> X, org.nd4j.linalg.api.ndarray.INDArray yArray)
    Row-wise cosine similarity between two equal-width matrices.
    static org.nd4j.linalg.api.ndarray.INDArray
    cosineSimilarity(org.nd4j.linalg.api.ndarray.INDArray xArray, List<List<Float>> Y)
    Row-wise cosine similarity between two equal-width matrices.
    static org.nd4j.linalg.api.ndarray.INDArray
    cosineSimilarity(org.nd4j.linalg.api.ndarray.INDArray xArray, org.nd4j.linalg.api.ndarray.INDArray yArray)
    Row-wise cosine similarity between two equal-width matrices.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • cosineSimilarity

      public static org.nd4j.linalg.api.ndarray.INDArray cosineSimilarity(List<List<Float>> X, org.nd4j.linalg.api.ndarray.INDArray yArray)
      Row-wise cosine similarity between two equal-width matrices.
    • cosineSimilarity

      public static org.nd4j.linalg.api.ndarray.INDArray cosineSimilarity(org.nd4j.linalg.api.ndarray.INDArray xArray, List<List<Float>> Y)
      Row-wise cosine similarity between two equal-width matrices.
    • cosineSimilarity

      public static org.nd4j.linalg.api.ndarray.INDArray cosineSimilarity(org.nd4j.linalg.api.ndarray.INDArray xArray, org.nd4j.linalg.api.ndarray.INDArray yArray)
      Row-wise cosine similarity between two equal-width matrices.