SHOGUN  3.2.1
 全部  命名空间 文件 函数 变量 类型定义 枚举 枚举值 友元 宏定义 
函数
shogun::linalg::special_purpose 命名空间参考

函数

template<Backend backend = linalg_traits<Core>::backend, class Matrix >
void logistic (Matrix A, Matrix result)
 
template<Backend backend = linalg_traits<Core>::backend, class Matrix >
void multiply_by_logistic_derivative (Matrix A, Matrix C)
 
template<Backend backend = linalg_traits<Core>::backend, class Matrix >
void rectified_linear (Matrix A, Matrix result)
 
template<Backend backend = linalg_traits<Core>::backend, class Matrix >
void multiply_by_rectified_linear_derivative (Matrix A, Matrix C)
 
template<Backend backend = linalg_traits<Core>::backend, class Matrix >
void softmax (Matrix A)
 
template<Backend backend = linalg_traits<Core>::backend, class Matrix >
Matrix::Scalar cross_entropy (Matrix P, Matrix Q)
 
template<Backend backend = linalg_traits<Core>::backend, class Matrix >
Matrix::Scalar squared_error (Matrix P, Matrix Q)
 

函数说明

Matrix::Scalar shogun::linalg::special_purpose::cross_entropy ( Matrix  P,
Matrix  Q 
)

Returns the cross entropy between P and Q. The cross entropy is defined as \( H(P,Q) = - \sum_{ij} P[i,j]log(Q[i,j]) \)

在文件 modules/SpecialPurpose.h90 行定义.

void shogun::linalg::special_purpose::logistic ( Matrix  A,
Matrix  result 
)

Applies the elementwise logistic function f(x) = 1/(1+exp(-x)) to a matrix

在文件 modules/SpecialPurpose.h51 行定义.

void shogun::linalg::special_purpose::multiply_by_logistic_derivative ( Matrix  A,
Matrix  C 
)

Performs the operation C(i,j) = C(i,j) * A(i,j) * (1.0-A(i,j) for all i and j

在文件 modules/SpecialPurpose.h58 行定义.

void shogun::linalg::special_purpose::multiply_by_rectified_linear_derivative ( Matrix  A,
Matrix  C 
)

Performs the operation C(i,j) = C(i,j) * (A(i,j)!=0) for all i and j

在文件 modules/SpecialPurpose.h72 行定义.

void shogun::linalg::special_purpose::rectified_linear ( Matrix  A,
Matrix  result 
)

Applies the elementwise rectified linear function f(x) = max(0,x) to a matrix

在文件 modules/SpecialPurpose.h65 行定义.

void shogun::linalg::special_purpose::softmax ( Matrix  A)

Applies the softmax function inplace to a matrix. The softmax function is defined as \( f(A[i,j]) = \frac{exp(A[i,j])}{\sum_i exp(A[i,j])} \)

在文件 modules/SpecialPurpose.h81 行定义.

Matrix::Scalar shogun::linalg::special_purpose::squared_error ( Matrix  P,
Matrix  Q 
)

Returns the squared error between P and Q. The squared error is defined as \( E(P,Q) = \frac{1}{2} \sum_{ij} (P[i,j]-Q[i,j])^2 \)

在文件 modules/SpecialPurpose.h99 行定义.


SHOGUN 机器学习工具包 - 项目文档