src/mlpack/tests/activation_functions_test.cpp
void CheckPReLUActivationCorrect(const arma::colvec input,
                                 const arma::colvec target)
{
  PReLU<> prelu;

  // Test the activation function using the entire vector as input.
  arma::colvec activations;
  prelu.Forward(input, activations);
  for (size_t i = 0; i < activations.n_elem; i++)
  {
    BOOST_REQUIRE_CLOSE(activations.at(i), target.at(i), 1e-3);
  }
}
/**
 * Implementation of the PReLU activation function test. The function
 * is implemented as PReLU layer in the file parametric_relu.hpp.
 *
 * @param input Input data used for evaluating the PReLU activation
 *   function.
 * @param target Target data used to evaluate the PReLU activation.
 */
Implementation of the PReLU activation function test. The function
is implemented as PReLU layer in the file parametric_relu.hpp.

@param input Input data used for evaluating the PReLU activation
function.
@param target Target data used to evaluate the PReLU activation.
Implementation of the PReLU activation function test . The function is implemented as PReLU layer in the file parametric_relu . hpp . @param input Input data used for evaluating the PReLU activation function . @param target Target data used to evaluate the PReLU activation .
void CheckPReLUActivationCorrect(const arma::colvec input,
                                 const arma::colvec target)
{
  PReLU<> prelu;
  arma::colvec activations;
  prelu.Forward(input, activations);
  for (size_t i = 0; i < activations.n_elem; i++)
  {
    BOOST_REQUIRE_CLOSE(activations.at(i), target.at(i), 1e-3);
  }
}
void CheckPReLUActivationCorrect ( const arma :: colvec input , const arma :: colvec target ) { PReLU < > prelu ; arma :: colvec activations ; prelu . Forward ( input , activations ) ; for ( size_t i = 0 ; i < activations . n_elem ; i ++ ) { BOOST_REQUIRE_CLOSE ( activations . at ( i ) , target . at ( i ) , 1e-3 ) ; } }
Implementation of the PReLU activation function test.
Implementation of the PReLU activation function test .
// Test the activation function using the entire vector as input.