24 template<
typename Real_t>
33 for (
size_t i = 0; i <
m; i++) {
34 for (
size_t j = 0; j <
n; j++) {
39 result /= (
Real_t) (m * n);
44 template<
typename Real_t>
54 dY *= - 2.0 / ((
Real_t) (m*n));
58 template<
typename Real_t>
67 for (
size_t i = 0; i <
m; i++) {
68 for (
size_t j = 0; j <
n; j++) {
74 result /= - (
Real_t) (m * n);
79 template<
typename Real_t>
89 for (
size_t i = 0; i <
m; i++)
91 for (
size_t j = 0; j <
n; j++)
95 dY(i,j) = norm * (sig -
y);
static Real_t CrossEntropy(const TMatrixT< Real_t > &Y, const TMatrixT< Real_t > &output)
Sigmoid transformation is implicitly applied, thus output should hold the linear activations of the l...
static Real_t MeanSquaredError(const TMatrixT< Real_t > &Y, const TMatrixT< Real_t > &output)
static void MeanSquaredErrorGradients(TMatrixT< Real_t > &dY, const TMatrixT< Real_t > &Y, const TMatrixT< Real_t > &output)
static void CrossEntropyGradients(TMatrixT< Real_t > &dY, const TMatrixT< Real_t > &Y, const TMatrixT< Real_t > &output)
void Minus(const TMatrixT< Element > &a, const TMatrixT< Element > &b)
General matrix summation. Create a matrix C such that C = A - B.
Abstract ClassifierFactory template that handles arbitrary types.
static void output(int code)
double norm(double *x, double *p)