ann_test_tools.hpp File Reference
Include dependency graph for ann_test_tools.hpp:

Go to the source code of this file.

Functions

template
<
class
FunctionType
>
double CheckGradient (FunctionType &function, const double eps=1e-7)
 
template
<
class
FunctionType
>
double CheckRegularizerGradient (FunctionType &function, const double eps=1e-7)
 
template
<
typename
ModuleType
>
double JacobianPerformanceTest (ModuleType &module, arma::mat &input, arma::mat &target, const double eps=1e-6)
 
template
<
typename
ModuleType
>
double JacobianTest (ModuleType &module, arma::mat &input, const double minValue=-2, const double maxValue=-1, const double perturbation=1e-6)
 
template
<
class
T
>
void ResetFunction (T &layer, typename std::enable_if< HasResetCheck< T, void(T::*)()>::value >::type *=0)
 
template
<
class
T
>
void ResetFunction (T &, typename std::enable_if<!HasResetCheck< T, void(T::*)()>::value >::type *=0)
 

Detailed Description

Author
Marcus Edel

This file includes some useful functions for ann tests.

mlpack is free software; you may redistribute it and/or modify it under the terms of the 3-clause BSD license. You should have received a copy of the 3-clause BSD license along with mlpack. If not, see http://www.opensource.org/licenses/BSD-3-Clause for more information.

Definition in file ann_test_tools.hpp.

Function Documentation

◆ CheckGradient()

double CheckGradient ( FunctionType &  function,
const double  eps = 1e-7 
)

Definition at line 137 of file ann_test_tools.hpp.

◆ CheckRegularizerGradient()

double CheckRegularizerGradient ( FunctionType &  function,
const double  eps = 1e-7 
)

Definition at line 172 of file ann_test_tools.hpp.

◆ JacobianPerformanceTest()

double JacobianPerformanceTest ( ModuleType &  module,
arma::mat &  input,
arma::mat &  target,
const double  eps = 1e-6 
)

Definition at line 104 of file ann_test_tools.hpp.

◆ JacobianTest()

double JacobianTest ( ModuleType &  module,
arma::mat &  input,
const double  minValue = -2,
const double  maxValue = -1,
const double  perturbation = 1e-6 
)

Definition at line 40 of file ann_test_tools.hpp.

References RandomInitialization::Initialize(), and ResetFunction().

◆ ResetFunction() [1/2]

void ResetFunction ( T &  layer,
typename std::enable_if< HasResetCheck< T, void(T::*)()>::value >::type *  = 0 
)

Definition at line 22 of file ann_test_tools.hpp.

Referenced by JacobianTest().

◆ ResetFunction() [2/2]

void ResetFunction ( T &  ,
typename std::enable_if<!HasResetCheck< T, void(T::*)()>::value >::type *  = 0 
)

Definition at line 30 of file ann_test_tools.hpp.