mlpack
Classes | Macros | Functions
sparse_coding_test.cpp File Reference
#include <string>
#include <mlpack/core.hpp>
#include <mlpack/core/util/mlpack_main.hpp>
#include <mlpack/methods/sparse_coding/sparse_coding_main.cpp>
#include "test_helper.hpp"
#include "../catch.hpp"
#include "../test_catch_tools.hpp"
Include dependency graph for sparse_coding_test.cpp:

Classes

struct  SparseCodingTestFixture
 

Macros

#define BINDING_TYPE   BINDING_TYPE_TEST
 

Functions

void LoadData (arma::mat &inputData, arma::mat &testData)
 Helper function to load datasets.
 
 TEST_CASE_METHOD (SparseCodingTestFixture, "SparseCodingOutputDimensionTest", "[SparseCodingMainTest][BindingTests]")
 Make sure that output points in dictionary equals number of atoms passed and codes have desired dimension.
 
 TEST_CASE_METHOD (SparseCodingTestFixture, "SparseCodingNormalizationTest", "[SparseCodingMainTest][BindingTests]")
 Ensure that training data is normalized if normalize parameter is set to true.
 
 TEST_CASE_METHOD (SparseCodingTestFixture, "SparseCodingBoundsTest", "[SparseCodingMainTest][BindingTests]")
 Ensure that l1, l2, max_iterations, objective_tolerance, newton_tolerance value is always non-negative and number of atoms is always positive.
 
 TEST_CASE_METHOD (SparseCodingTestFixture, "SparseCodingReqAtomsTest", "[SparseCodingMainTest][BindingTests]")
 Make sure atoms are specified if training data is passed.
 
 TEST_CASE_METHOD (SparseCodingTestFixture, "SparseCodingModelVerTest", "[SparseCodingMainTest][BindingTests]")
 Ensure only one of input_model or initial_dictionary is specified.
 
 TEST_CASE_METHOD (SparseCodingTestFixture, "SparseCodingAtomsVerTest", "[SparseCodingMainTest][BindingTests]")
 Ensure that specified number of atoms and initial_dictionary atoms are equal.
 
 TEST_CASE_METHOD (SparseCodingTestFixture, "SparseCodingRowsVerTest", "[SparseCodingMainTest][BindingTests]")
 Ensure that input data and initial_dictionary have same number of rows.
 
 TEST_CASE_METHOD (SparseCodingTestFixture, "SparseCodingDataDimensionalityTest", "[SparseCodingMainTest][BindingTests]")
 Ensure that training data and test data have same dimensionality w.r.t rows.
 
 TEST_CASE_METHOD (SparseCodingTestFixture, "SparseCodingModelReuseTest", "[SparseCodingMainTest][BindingTests]")
 Check that saved model can be reused again.
 
 TEST_CASE_METHOD (SparseCodingTestFixture, "SparseCodingDiffMaxItrTest", "[SparseCodingMainTest][BindingTests]")
 Ensure that for different value of max iterations outputs are different.
 
 TEST_CASE_METHOD (SparseCodingTestFixture, "SparseCodingDiffObjToleranceTest", "[SparseCodingMainTest][BindingTests]")
 Ensure that for different value of objective_tolerance outputs are different.
 
 TEST_CASE_METHOD (SparseCodingTestFixture, "SparseCodingDiffNewtonToleranceTest", "[SparseCodingMainTest][BindingTests]")
 Ensure that for different value of newton_tolerance outputs are different.
 
 TEST_CASE_METHOD (SparseCodingTestFixture, "SparseCodingDiffL1Test", "[SparseCodingMainTest][BindingTests]")
 Ensure that for different value of lambda1 outputs are different.
 
 TEST_CASE_METHOD (SparseCodingTestFixture, "SparseCodingDiffL2Test", "[SparseCodingMainTest][BindingTests]")
 Ensure that for different value of lambda2 outputs are different.
 
 TEST_CASE_METHOD (SparseCodingTestFixture, "SparseCodingDiffL1L2Test", "[SparseCodingMainTest][BindingTests]")
 Ensure that for different value of lambda1 & lambda2 outputs are different.
 

Detailed Description

Author
Manish Kumar

Test mlpackMain() of sparse_coding_main.cpp.

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.