Package schule.ngb.zm.ml
Class MLMath
java.lang.Object
schule.ngb.zm.ml.MLMath
-
Method Summary
Modifier and TypeMethodDescriptionstatic double[][]
biasAdd
(double[][] A, double[] V) static double[]
biasAdjust
(double[] biases, double[][] delta) static double[][]
copyMatrix
(double[][] matrix) static double
entropy
(double[][] A, double[][] Y, int batch_size) static double[][]
matrixAdd
(double[][] A, double[][] B) static double[][]
matrixApply
(double[][] A, DoubleUnaryOperator op) static double[][]
matrixMultiply
(double[][] A, double[][] B) static double[][]
matrixScale
(double[][] A, double[][] S) static double[][]
matrixSub
(double[][] A, double[][] B) static double[][]
matrixTranspose
(double[][] matrix) static double[]
normalize
(double[] vector) static double
sigmoid
(double x) static double
sigmoidDerivative
(double x) static double
tanh
(double x) static double
tanhDerivative
(double x) static double[][]
toMatrix
(double[] vector) static double[]
toVector
(double[][] matrix)
-
Method Details
-
sigmoid
public static double sigmoid(double x) -
sigmoidDerivative
public static double sigmoidDerivative(double x) -
tanh
public static double tanh(double x) -
tanhDerivative
public static double tanhDerivative(double x) -
normalize
public static double[] normalize(double[] vector) -
matrixMultiply
public static double[][] matrixMultiply(double[][] A, double[][] B) -
matrixScale
public static double[][] matrixScale(double[][] A, double[][] S) -
matrixSub
public static double[][] matrixSub(double[][] A, double[][] B) -
matrixAdd
public static double[][] matrixAdd(double[][] A, double[][] B) -
matrixTranspose
public static double[][] matrixTranspose(double[][] matrix) -
matrixApply
-
copyMatrix
public static double[][] copyMatrix(double[][] matrix) -
toVector
public static double[] toVector(double[][] matrix) -
toMatrix
public static double[][] toMatrix(double[] vector) -
entropy
public static double entropy(double[][] A, double[][] Y, int batch_size) -
biasAdd
public static double[][] biasAdd(double[][] A, double[] V) -
biasAdjust
public static double[] biasAdjust(double[] biases, double[][] delta)
-