Logo ROOT   6.07/09
Reference Guide
Functions
TestDerivatives.h File Reference
#include <iostream>
#include "TMVA/DNN/Functions.h"
#include "TMVA/DNN/Net.h"
#include "Utility.h"
Include dependency graph for TestDerivatives.h:
This graph shows which files directly or indirectly include this file:

Functions

template<typename Architecture >
auto testActivationFunctionDerivatives () -> typename Architecture::Scalar_t
 Test derivatives of all activation functions and return the maximum relative error. More...
 
template<typename Architecture , typename F , typename dF >
auto testDerivatives (F f, dF df, typename Architecture::Scalar_t dx) -> typename Architecture::Scalar_t
 Generic function that numerically computes the derivative of a matrix function f and the analytical solution given by df the function signatures are assumed to be. More...
 
template<typename Architecture , typename F , typename dF >
auto testGradients (F f, dF df, typename Architecture::Scalar_t dx) -> typename Architecture::Scalar_t
 Similar to testDerivatives only that here the mathematical function is expected to be a matrix functional, i.e. More...
 
template<typename Architecture >
auto testLossFunctionGradients () -> typename Architecture::Scalar_t
 Test gradients of all loss function for the given architecture type and return the maximum relative error. More...
 
template<typename Architecture >
auto testRegularizationGradients () -> typename Architecture::Scalar_t
 Test the computation of gradients for all differentiable regularization types, which is so far only L2 and no regularization and print the results to standard out. More...
 

Function Documentation

template<typename Architecture >
auto testActivationFunctionDerivatives ( ) -> typename Architecture::Scalar_t

Test derivatives of all activation functions and return the maximum relative error.

Prints the result for each function to the stdout.

Definition at line 83 of file TestDerivatives.h.

template<typename Architecture , typename F , typename dF >
auto testDerivatives ( F  f,
dF  df,
typename Architecture::Scalar_t  dx 
) -> typename Architecture::Scalar_t

Generic function that numerically computes the derivative of a matrix function f and the analytical solution given by df the function signatures are assumed to be.

  • void f(Matrix_t &X)
  • void df(Matrix_t &Y, const Matrix_t &X) -> derivative of f at X(i,j) is The function f is supposed to apply the corresponding mathematical function to each element in the provided matrix X. The function df is expected to set each element in Y to the derivative of the corresponding mathematical function evaluated at the corresponding element in X.

Definition at line 46 of file TestDerivatives.h.

template<typename Architecture , typename F , typename dF >
auto testGradients ( F  f,
dF  df,
typename Architecture::Scalar_t  dx 
) -> typename Architecture::Scalar_t

Similar to testDerivatives only that here the mathematical function is expected to be a matrix functional, i.e.

to be mapping a matrix to a scalar value. The scalar value is supposed to be computed by the provided function object f, while the function object is just like above.

Definition at line 128 of file TestDerivatives.h.

template<typename Architecture >
auto testLossFunctionGradients ( ) -> typename Architecture::Scalar_t

Test gradients of all loss function for the given architecture type and return the maximum relative error.

Prints results for each function to standard out.

Definition at line 171 of file TestDerivatives.h.

template<typename Architecture >
auto testRegularizationGradients ( ) -> typename Architecture::Scalar_t

Test the computation of gradients for all differentiable regularization types, which is so far only L2 and no regularization and print the results to standard out.

Definition at line 217 of file TestDerivatives.h.