13#include <NeMachineLearningLib.h>
14#include <Core/NeLogger.h>
15#include <MachineLearning/FgArrayFireSerialization.h>
21 namespace MachineLearning
25 : std::integral_constant<
27 std::is_same<double, typename std::remove_cv<T>::type>::value> {};
31 : std::integral_constant<
33 std::is_same<float, typename std::remove_cv<T>::type>::value> {};
35 template<
typename Scalar>
61 static af::array
Euclidean(
const af::array& a,
const af::array& b);
181 static af::array
ScaledDistance(
const af::array& inX1,
const af::array& inX2,
const af::array& inLengtScale);
200 static af::array
NormalPDF(
const af::array& inX,
const af::array& inMu = af::array(),
const af::array& inSigma = af::array());
219 static af::array
LogNormalPDF(
const af::array& inX,
const af::array& inMu = af::array(),
const af::array& inSigma = af::array());
238 static af::array
NormalCDF(
const af::array& inX,
const af::array& inMu = af::array(),
const af::array& inSigma = af::array());
257 static af::array
LogNormalCDF(
const af::array& inX,
const af::array& inMu = af::array(),
const af::array& inSigma = af::array());
319 static af::array
JitChol(
const af::array& inA);
332 static void MergeMaps(std::map<std::string, af::array>& lhs,
const std::map<std::string, af::array>& rhs);
355 static af::array
Join(
const af::array& inA,
const af::array& inB,
int dimension = 0);
371 static af::array
SolveQR(
const af::array& A,
const af::array& b);
393 static af::array
ReadTXT(std::string filename,
char delimiter =
' ');
406 static bool WriteTXT(
const af::array& data, std::string filename,
char delimiter =
' ');
418 static bool IsEqual(
const af::array& a,
const af::array& b);
static af::array LinSpace(Scalar start, Scalar stop, int num, bool endpoint=true)
Implementation of NumPy's Linspace.
static af::array LogNormalPDF(const af::array &inX, const af::array &inMu=af::array(), const af::array &inSigma=af::array())
Log normal probability density function.
static bool IsEqual(const af::array &a, const af::array &b)
Query if 'a' is equal to 'b'.
static af::array NormalCDF(const af::array &inX, const af::array &inMu=af::array(), const af::array &inSigma=af::array())
Normal cumulative distribution function..
static Scalar Max(Scalar a, Scalar b, Scalar c)
Gets the maximum value among three values.
static af::array SquareEuclidean(const af::array &a, const af::array &b)
Gets the Square Euclidean norm for a vector.
static af::dtype CheckDType()
Checks af::array precision flag.
static af::array TriLowerIdx(int size)
Computes indexes of lower triangular matrix.
static af::array ScaledDistance(const af::array &inX1, const af::array &inX2, const af::array &inLengtScale)
Scaled distance.
static Scalar LogDet(af::array inA)
Log determinant of the input matrix.
static af::array SortRows(af::array inA)
Sort rows.
static Scalar SquareEuclidean(const af::array &a)
Gets the Square Euclidean norm for two vectors.
static af::array ReadTXT(std::string filename, char delimiter=' ')
Loads an array from a text file.
static af::array TriUpperIdx(int size, int dimension=0)
Computes indexes of upper triangular matrix.
static af::array SolveQR(const af::array &A, const af::array &b)
Linear solve usingQR decomposition.
static af::array LogNormalCDF(const af::array &inX, const af::array &inMu=af::array(), const af::array &inSigma=af::array())
Log normal cumulative distribution function.
static af::array DiagIdx(int size)
Indexes of matrix diagonal.
static af::array CorrelationCoefficients(const af::array &inX, const af::array &inY=af::array())
Correlation coefficients.
static bool WriteTXT(const af::array &data, std::string filename, char delimiter=' ')
Writes an array to a text file.
static af::array Euclidean(const af::array &a, const af::array &b)
Gets the Euclidean norm for two vectors.
static af::array Join(const af::array &inA, const af::array &inB, int dimension=0)
Joins matrices and vectors along specific dimension.
static af::array NormalPDF(const af::array &inX, const af::array &inMu=af::array(), const af::array &inSigma=af::array())
Normal probability density function.
static af::array SquareDistance(const af::array &inX1, const af::array &inX2)
Gets standardized Square Euclidean distance.
static Scalar Euclidean(const af::array &a)
Gets the Euclidean norm for a vector.
static af::array Covariance(const af::array &M)
Covariance.
static af::array UnscaledDistance(const af::array &inX1, const af::array &inX2)
Unscaled distance.
static af::array PDInverse(const af::array &inA)
Computes the pseudo inverse of a matrix.
static af::array JitChol(const af::array &inA)
Cholesky decomposition.