From 368cc4668066529302005ddbc7834007f7cdd05b Mon Sep 17 00:00:00 2001 From: Sebastian Brodehl Date: Sat, 6 Jan 2018 13:39:06 +0100 Subject: [PATCH 1/7] Add missing files, rearrange includes, remove unused cmake files. --- src/mlpack/CMakeLists.txt | 5 ++++- src/mlpack/bindings/cli/CMakeLists.txt | 1 + src/mlpack/bindings/tests/CMakeLists.txt | 1 + src/mlpack/core/arma_extend/CMakeLists.txt | 1 + src/mlpack/core/data/CMakeLists.txt | 1 + src/mlpack/core/data/map_policies/CMakeLists.txt | 1 + src/mlpack/core/math/CMakeLists.txt | 4 ++++ src/mlpack/core/optimizers/CMakeLists.txt | 3 +++ .../core/optimizers/parallel_sgd/CMakeLists.txt | 2 ++ .../parallel_sgd/decay_policies/CMakeLists.txt | 11 ----------- src/mlpack/core/optimizers/scd/CMakeLists.txt | 3 +++ .../optimizers/sgd/update_policies/CMakeLists.txt | 11 ----------- src/mlpack/core/tree/CMakeLists.txt | 3 +++ src/mlpack/core/util/CMakeLists.txt | 4 ++++ src/mlpack/methods/CMakeLists.txt | 6 +++--- src/mlpack/methods/amf/CMakeLists.txt | 8 ++++---- src/mlpack/methods/ann/CMakeLists.txt | 14 +++++++------- .../methods/ann/augmented/tasks/CMakeLists.txt | 4 ++++ src/mlpack/methods/ann/layer/CMakeLists.txt | 2 +- src/mlpack/methods/fastmks/CMakeLists.txt | 1 + src/mlpack/methods/hmm/CMakeLists.txt | 2 ++ src/mlpack/methods/kernel_pca/CMakeLists.txt | 4 ++-- src/mlpack/methods/pca/CMakeLists.txt | 4 ++-- src/mlpack/methods/perceptron/CMakeLists.txt | 6 +++--- .../methods/reinforcement_learning/CMakeLists.txt | 9 +++++---- src/mlpack/tests/CMakeLists.txt | 1 + 26 files changed, 63 insertions(+), 49 deletions(-) delete mode 100644 src/mlpack/core/optimizers/parallel_sgd/decay_policies/CMakeLists.txt delete mode 100644 src/mlpack/core/optimizers/sgd/update_policies/CMakeLists.txt diff --git a/src/mlpack/CMakeLists.txt b/src/mlpack/CMakeLists.txt index a8a5a3f730..f2d2af43e6 100644 --- a/src/mlpack/CMakeLists.txt +++ b/src/mlpack/CMakeLists.txt @@ -1,7 +1,10 @@ include_directories(${CMAKE_CURRENT_BINARY_DIR}/..) # mlpack/mlpack_export.hpp # Add core.hpp to list of sources. -set(MLPACK_SRCS ${MLPACK_SRCS} "${CMAKE_CURRENT_SOURCE_DIR}/core.hpp") +set(MLPACK_SRCS ${MLPACK_SRCS} + "${CMAKE_CURRENT_SOURCE_DIR}/core.hpp" + "${CMAKE_CURRENT_SOURCE_DIR}/prereqs.hpp" +) ## Recurse into both core/ and methods/. set(DIRS diff --git a/src/mlpack/bindings/cli/CMakeLists.txt b/src/mlpack/bindings/cli/CMakeLists.txt index cea07895d6..095fee3c1a 100644 --- a/src/mlpack/bindings/cli/CMakeLists.txt +++ b/src/mlpack/bindings/cli/CMakeLists.txt @@ -23,6 +23,7 @@ set(SOURCES print_doc_functions_impl.hpp print_help.hpp print_help.cpp + set_param.hpp string_type_param.hpp string_type_param_impl.hpp ) diff --git a/src/mlpack/bindings/tests/CMakeLists.txt b/src/mlpack/bindings/tests/CMakeLists.txt index fe2cb46e6e..5955a0a514 100644 --- a/src/mlpack/bindings/tests/CMakeLists.txt +++ b/src/mlpack/bindings/tests/CMakeLists.txt @@ -2,6 +2,7 @@ # Anything not in this list will not be compiled into mlpack. set(SOURCES test_option.hpp + ignore_check.hpp get_param.hpp get_printable_param.hpp get_printable_param_impl.hpp diff --git a/src/mlpack/core/arma_extend/CMakeLists.txt b/src/mlpack/core/arma_extend/CMakeLists.txt index cfa10c69e4..fc218442f4 100644 --- a/src/mlpack/core/arma_extend/CMakeLists.txt +++ b/src/mlpack/core/arma_extend/CMakeLists.txt @@ -3,6 +3,7 @@ set(SOURCES arma_extend.hpp fn_ccov.hpp + fn_inplace_reshape.hpp glue_ccov_meat.hpp glue_ccov_proto.hpp hdf5_misc.hpp diff --git a/src/mlpack/core/data/CMakeLists.txt b/src/mlpack/core/data/CMakeLists.txt index e2b79d3d30..ba2fb682da 100644 --- a/src/mlpack/core/data/CMakeLists.txt +++ b/src/mlpack/core/data/CMakeLists.txt @@ -19,6 +19,7 @@ set(SOURCES normalize_labels_impl.hpp save.hpp save_impl.hpp + serialization_template_version.hpp split_data.hpp imputer.hpp binarize.hpp diff --git a/src/mlpack/core/data/map_policies/CMakeLists.txt b/src/mlpack/core/data/map_policies/CMakeLists.txt index 9b40fcc19c..be2718c247 100644 --- a/src/mlpack/core/data/map_policies/CMakeLists.txt +++ b/src/mlpack/core/data/map_policies/CMakeLists.txt @@ -3,6 +3,7 @@ set(SOURCES increment_policy.hpp missing_policy.hpp + datatype.hpp ) # Add directory name to sources. diff --git a/src/mlpack/core/math/CMakeLists.txt b/src/mlpack/core/math/CMakeLists.txt index 2ac2c04e8e..cc78370f2f 100644 --- a/src/mlpack/core/math/CMakeLists.txt +++ b/src/mlpack/core/math/CMakeLists.txt @@ -7,13 +7,17 @@ set(SOURCES lin_alg.hpp lin_alg_impl.hpp lin_alg.cpp + make_alias.hpp random.hpp random.cpp random_basis.hpp random_basis.cpp range.hpp range_impl.hpp + range_serialization.hpp + range_serialization.cpp round.hpp + shuffle_data.hpp ) # add directory name to sources diff --git a/src/mlpack/core/optimizers/CMakeLists.txt b/src/mlpack/core/optimizers/CMakeLists.txt index 1dd8bb4e51..77d21caafe 100644 --- a/src/mlpack/core/optimizers/CMakeLists.txt +++ b/src/mlpack/core/optimizers/CMakeLists.txt @@ -12,10 +12,13 @@ set(DIRS lbfgs line_search proximal + parallel_sgd rmsprop sa + scd sdp sgd + sgdr smorms3 spalera_sgd ) diff --git a/src/mlpack/core/optimizers/parallel_sgd/CMakeLists.txt b/src/mlpack/core/optimizers/parallel_sgd/CMakeLists.txt index 1803f5273f..406df87b40 100644 --- a/src/mlpack/core/optimizers/parallel_sgd/CMakeLists.txt +++ b/src/mlpack/core/optimizers/parallel_sgd/CMakeLists.txt @@ -1,4 +1,6 @@ set(SOURCES + decay_policies/constant_step.hpp + decay_policies/exponential_backoff.hpp parallel_sgd.hpp parallel_sgd_impl.hpp sparse_test_function.hpp diff --git a/src/mlpack/core/optimizers/parallel_sgd/decay_policies/CMakeLists.txt b/src/mlpack/core/optimizers/parallel_sgd/decay_policies/CMakeLists.txt deleted file mode 100644 index 9bf1b40964..0000000000 --- a/src/mlpack/core/optimizers/parallel_sgd/decay_policies/CMakeLists.txt +++ /dev/null @@ -1,11 +0,0 @@ -set(SOURCES - constant_step.hpp - exponential_backoff.hpp -) - -set(DIR_SRCS) -foreach(file ${SOURCES}) - set(DIR_SRCS ${DIR_SRCS} ${CMAKE_CURRENT_SOURCE_DIR}/${file}) -endforeach() - -set(MLPACK_SRCS ${MLPACK_SRCS} ${DIR_SRCS} PARENT_SCOPE) diff --git a/src/mlpack/core/optimizers/scd/CMakeLists.txt b/src/mlpack/core/optimizers/scd/CMakeLists.txt index 0693192b08..6d145ec776 100644 --- a/src/mlpack/core/optimizers/scd/CMakeLists.txt +++ b/src/mlpack/core/optimizers/scd/CMakeLists.txt @@ -1,4 +1,7 @@ set(SOURCES + descent_policies/cyclic_descent.hpp + descent_policies/greedy_descent.hpp + descent_policies/random_descent.hpp scd.hpp scd_impl.hpp ) diff --git a/src/mlpack/core/optimizers/sgd/update_policies/CMakeLists.txt b/src/mlpack/core/optimizers/sgd/update_policies/CMakeLists.txt deleted file mode 100644 index 36d87a97eb..0000000000 --- a/src/mlpack/core/optimizers/sgd/update_policies/CMakeLists.txt +++ /dev/null @@ -1,11 +0,0 @@ -set(SOURCES - vanilla_update.hpp - momentum_update.hpp -) - -set(DIR_SRCS) -foreach(file ${SOURCES}) - set(DIR_SRCS ${DIR_SRCS} ${CMAKE_CURRENT_SOURCE_DIR}/${file}) -endforeach() - -set(MLPACK_SRCS ${MLPACK_SRCS} ${DIR_SRCS} PARENT_SCOPE) diff --git a/src/mlpack/core/tree/CMakeLists.txt b/src/mlpack/core/tree/CMakeLists.txt index 0b2f01a5f3..ebba35b1cc 100644 --- a/src/mlpack/core/tree/CMakeLists.txt +++ b/src/mlpack/core/tree/CMakeLists.txt @@ -33,6 +33,7 @@ set(SOURCES cellbound_impl.hpp cosine_tree/cosine_tree.hpp cosine_tree/cosine_tree.cpp + cover_tree.hpp cover_tree/cover_tree.hpp cover_tree/cover_tree_impl.hpp cover_tree/first_point_is_root.hpp @@ -74,6 +75,8 @@ set(SOURCES rectangle_tree/r_star_tree_descent_heuristic_impl.hpp rectangle_tree/r_star_tree_split.hpp rectangle_tree/r_star_tree_split_impl.hpp + rectangle_tree/traits.hpp + rectangle_tree/typedef.hpp rectangle_tree/x_tree_split.hpp rectangle_tree/x_tree_split_impl.hpp rectangle_tree/x_tree_auxiliary_information.hpp diff --git a/src/mlpack/core/util/CMakeLists.txt b/src/mlpack/core/util/CMakeLists.txt index 0b1158974d..d3d3071978 100644 --- a/src/mlpack/core/util/CMakeLists.txt +++ b/src/mlpack/core/util/CMakeLists.txt @@ -1,6 +1,7 @@ # Define the files we need to compile. # Anything not in this list will not be compiled into mlpack. set(SOURCES + arma_traits.hpp arma_config.hpp arma_config_check.hpp backtrace.hpp @@ -11,15 +12,18 @@ set(SOURCES cli_deleter.cpp cli_impl.hpp deprecated.hpp + gitversion.hpp hyphenate_string.hpp is_std_vector.hpp log.hpp log.cpp mlpack_main.hpp nulloutstream.hpp + param.hpp param_checks.hpp param_checks_impl.hpp param_data.hpp + param_data_impl.hpp prefixedoutstream.hpp prefixedoutstream.cpp prefixedoutstream_impl.hpp diff --git a/src/mlpack/methods/CMakeLists.txt b/src/mlpack/methods/CMakeLists.txt index d93badfec9..26b771cce2 100644 --- a/src/mlpack/methods/CMakeLists.txt +++ b/src/mlpack/methods/CMakeLists.txt @@ -45,13 +45,12 @@ set(DIRS local_coordinate_coding logistic_regression lsh -# mvu + mvu matrix_completion naive_bayes nca neighbor_search nmf -# lmf pca perceptron quic_svd @@ -60,11 +59,12 @@ set(DIRS random_forest range_search rann -# rmva regularized_svd + reinforcement_learning softmax_regression sparse_autoencoder sparse_coding + sparse_svm nystroem_method ) diff --git a/src/mlpack/methods/amf/CMakeLists.txt b/src/mlpack/methods/amf/CMakeLists.txt index 8a3d06b6f1..4f98ff4087 100644 --- a/src/mlpack/methods/amf/CMakeLists.txt +++ b/src/mlpack/methods/amf/CMakeLists.txt @@ -5,6 +5,10 @@ set(SOURCES amf_impl.hpp ) +add_subdirectory(update_rules) +add_subdirectory(init_rules) +add_subdirectory(termination_policies) + # Add directory name to sources. set(DIR_SRCS) foreach(file ${SOURCES}) @@ -13,7 +17,3 @@ endforeach() # Append sources (with directory name) to list of all mlpack sources (used at # the parent scope). set(MLPACK_SRCS ${MLPACK_SRCS} ${DIR_SRCS} PARENT_SCOPE) - -add_subdirectory(update_rules) -add_subdirectory(init_rules) -add_subdirectory(termination_policies) diff --git a/src/mlpack/methods/ann/CMakeLists.txt b/src/mlpack/methods/ann/CMakeLists.txt index 1ae17a8bff..afb71a9ac8 100644 --- a/src/mlpack/methods/ann/CMakeLists.txt +++ b/src/mlpack/methods/ann/CMakeLists.txt @@ -7,6 +7,13 @@ set(SOURCES rnn_impl.hpp ) +add_subdirectory(visitor) +add_subdirectory(activation_functions) +add_subdirectory(init_rules) +add_subdirectory(layer) +add_subdirectory(convolution_rules) +add_subdirectory(augmented) + # Add directory name to sources. set(DIR_SRCS) foreach(file ${SOURCES}) @@ -15,10 +22,3 @@ endforeach() # Append sources (with directory name) to list of all mlpack sources (used at # the parent scope). set(MLPACK_SRCS ${MLPACK_SRCS} ${DIR_SRCS} PARENT_SCOPE) - -add_subdirectory(visitor) -add_subdirectory(activation_functions) -add_subdirectory(init_rules) -add_subdirectory(layer) -add_subdirectory(convolution_rules) -add_subdirectory(augmented) diff --git a/src/mlpack/methods/ann/augmented/tasks/CMakeLists.txt b/src/mlpack/methods/ann/augmented/tasks/CMakeLists.txt index 73cee4d465..ced921e2db 100644 --- a/src/mlpack/methods/ann/augmented/tasks/CMakeLists.txt +++ b/src/mlpack/methods/ann/augmented/tasks/CMakeLists.txt @@ -2,9 +2,13 @@ # Anything not in this list will not be compiled into mlpack. set(SOURCES add.hpp + add_impl.hpp copy.hpp + copy_impl.hpp score.hpp + score_impl.hpp sort.hpp + sort_impl.hpp ) # Add directory name to sources. diff --git a/src/mlpack/methods/ann/layer/CMakeLists.txt b/src/mlpack/methods/ann/layer/CMakeLists.txt index 1229781cbe..4729b2265c 100644 --- a/src/mlpack/methods/ann/layer/CMakeLists.txt +++ b/src/mlpack/methods/ann/layer/CMakeLists.txt @@ -69,7 +69,7 @@ set(SOURCES select_impl.hpp sequential.hpp sequential_impl.hpp - vr_class_reward_impl.hpp + vr_class_reward.hpp vr_class_reward_impl.hpp ) diff --git a/src/mlpack/methods/fastmks/CMakeLists.txt b/src/mlpack/methods/fastmks/CMakeLists.txt index 9e40fb77ae..d9a6a6a8eb 100644 --- a/src/mlpack/methods/fastmks/CMakeLists.txt +++ b/src/mlpack/methods/fastmks/CMakeLists.txt @@ -8,6 +8,7 @@ set(SOURCES fastmks_model.cpp fastmks_rules.hpp fastmks_rules_impl.hpp + fastmks_stat.hpp ) # Add directory name to sources. diff --git a/src/mlpack/methods/hmm/CMakeLists.txt b/src/mlpack/methods/hmm/CMakeLists.txt index be028d2b00..7add2baa33 100644 --- a/src/mlpack/methods/hmm/CMakeLists.txt +++ b/src/mlpack/methods/hmm/CMakeLists.txt @@ -6,6 +6,8 @@ set(SOURCES hmm_model.hpp hmm_regression.hpp hmm_regression_impl.hpp + hmm_util.hpp + hmm_util_impl.hpp ) # Add directory name to sources. diff --git a/src/mlpack/methods/kernel_pca/CMakeLists.txt b/src/mlpack/methods/kernel_pca/CMakeLists.txt index e1ef7173a3..c14a9f3ecb 100644 --- a/src/mlpack/methods/kernel_pca/CMakeLists.txt +++ b/src/mlpack/methods/kernel_pca/CMakeLists.txt @@ -5,6 +5,8 @@ set(SOURCES kernel_pca_impl.hpp ) +add_subdirectory(kernel_rules) + # Add directory name to sources. set(DIR_SRCS) foreach(file ${SOURCES}) @@ -14,7 +16,5 @@ endforeach() # the parent scope). set(MLPACK_SRCS ${MLPACK_SRCS} ${DIR_SRCS} PARENT_SCOPE) -add_subdirectory(kernel_rules) - add_cli_executable(kernel_pca) add_python_binding(kernel_pca) diff --git a/src/mlpack/methods/pca/CMakeLists.txt b/src/mlpack/methods/pca/CMakeLists.txt index 7ef6506454..097598ee8b 100644 --- a/src/mlpack/methods/pca/CMakeLists.txt +++ b/src/mlpack/methods/pca/CMakeLists.txt @@ -7,6 +7,8 @@ set(SOURCES # pca_nomain.cpp ) +add_subdirectory(decomposition_policies) + # Add directory name to sources. set(DIR_SRCS) foreach(file ${SOURCES}) @@ -16,7 +18,5 @@ endforeach() # the parent scope). set(MLPACK_SRCS ${MLPACK_SRCS} ${DIR_SRCS} PARENT_SCOPE) -add_subdirectory(decomposition_policies) - add_cli_executable(pca) add_python_binding(pca) diff --git a/src/mlpack/methods/perceptron/CMakeLists.txt b/src/mlpack/methods/perceptron/CMakeLists.txt index e1cfc43efd..f0b4afc596 100644 --- a/src/mlpack/methods/perceptron/CMakeLists.txt +++ b/src/mlpack/methods/perceptron/CMakeLists.txt @@ -7,6 +7,9 @@ set(SOURCES perceptron_impl.hpp ) +add_subdirectory(initialization_methods) +add_subdirectory(learning_policies) + # Add directory name to sources. set(DIR_SRCS) foreach(file ${SOURCES}) @@ -16,8 +19,5 @@ endforeach() # the parent scope). set(MLPACK_SRCS ${MLPACK_SRCS} ${DIR_SRCS} PARENT_SCOPE) -add_subdirectory(initialization_methods) -add_subdirectory(learning_policies) - add_cli_executable(perceptron) add_python_binding(perceptron) diff --git a/src/mlpack/methods/reinforcement_learning/CMakeLists.txt b/src/mlpack/methods/reinforcement_learning/CMakeLists.txt index 5ec1778dc8..a8910e7bfc 100644 --- a/src/mlpack/methods/reinforcement_learning/CMakeLists.txt +++ b/src/mlpack/methods/reinforcement_learning/CMakeLists.txt @@ -8,6 +8,11 @@ set(SOURCES training_config.hpp ) +add_subdirectory(environment) +add_subdirectory(policy) +add_subdirectory(replay) +add_subdirectory(worker) + # Add directory name to sources. set(DIR_SRCS) foreach(file ${SOURCES}) @@ -16,7 +21,3 @@ endforeach() # Append sources (with directory name) to list of all mlpack sources (used at # the parent scope). set(MLPACK_SRCS ${MLPACK_SRCS} ${DIR_SRCS} PARENT_SCOPE) - -add_subdirectory(environment) -add_subdirectory(estimator) -add_subdirectory(policy) diff --git a/src/mlpack/tests/CMakeLists.txt b/src/mlpack/tests/CMakeLists.txt index 7856240097..459c4e437b 100644 --- a/src/mlpack/tests/CMakeLists.txt +++ b/src/mlpack/tests/CMakeLists.txt @@ -116,6 +116,7 @@ add_executable(mlpack_test svd_batch_test.cpp svd_incremental_test.cpp termination_policy_test.cpp + test_tools.hpp timer_test.cpp tree_test.cpp tree_traits_test.cpp From 7a07b16fc610ed05fa4ee6c5dd45a5d23fd20dad Mon Sep 17 00:00:00 2001 From: Sebastian Brodehl Date: Sat, 6 Jan 2018 13:46:40 +0100 Subject: [PATCH 2/7] Fix lower case usage. --- src/mlpack/methods/amf/termination_policies/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mlpack/methods/amf/termination_policies/CMakeLists.txt b/src/mlpack/methods/amf/termination_policies/CMakeLists.txt index 4471d8a307..1538884124 100644 --- a/src/mlpack/methods/amf/termination_policies/CMakeLists.txt +++ b/src/mlpack/methods/amf/termination_policies/CMakeLists.txt @@ -3,7 +3,7 @@ set(SOURCES simple_residue_termination.hpp simple_tolerance_termination.hpp - validation_rmse_termination.hpp + validation_RMSE_termination.hpp incomplete_incremental_termination.hpp complete_incremental_termination.hpp max_iteration_termination.hpp From f9d58cea92e9b3cdfa7742a38b4164d202fb5e1c Mon Sep 17 00:00:00 2001 From: Sebastian Brodehl Date: Sun, 7 Jan 2018 11:17:51 +0100 Subject: [PATCH 3/7] Remove range_serialization.* files from project. --- src/mlpack/core/math/CMakeLists.txt | 2 -- src/mlpack/core/math/range_serialization.cpp | 13 --------- src/mlpack/core/math/range_serialization.hpp | 28 -------------------- 3 files changed, 43 deletions(-) delete mode 100644 src/mlpack/core/math/range_serialization.cpp delete mode 100644 src/mlpack/core/math/range_serialization.hpp diff --git a/src/mlpack/core/math/CMakeLists.txt b/src/mlpack/core/math/CMakeLists.txt index cc78370f2f..5eef44b959 100644 --- a/src/mlpack/core/math/CMakeLists.txt +++ b/src/mlpack/core/math/CMakeLists.txt @@ -14,8 +14,6 @@ set(SOURCES random_basis.cpp range.hpp range_impl.hpp - range_serialization.hpp - range_serialization.cpp round.hpp shuffle_data.hpp ) diff --git a/src/mlpack/core/math/range_serialization.cpp b/src/mlpack/core/math/range_serialization.cpp deleted file mode 100644 index 23259e6665..0000000000 --- a/src/mlpack/core/math/range_serialization.cpp +++ /dev/null @@ -1,13 +0,0 @@ -/** - * @file range_serialization.cpp - * @author Ryan Curtin - * - * Instantiation of Serialize() operators for math::Range. - */ -#include -#include "range_serialization.hpp" - -using namespace mlpack; -using namespace mlpack::math; - -MLPACK_SERIALIZATION_INSTANTIATE(Range); diff --git a/src/mlpack/core/math/range_serialization.hpp b/src/mlpack/core/math/range_serialization.hpp deleted file mode 100644 index 2ca491c341..0000000000 --- a/src/mlpack/core/math/range_serialization.hpp +++ /dev/null @@ -1,28 +0,0 @@ -/** - * @file range_serialization.hpp - * @author Ryan Curtin - * - * Implementations of Serialize() for math::Range. - */ -#ifndef MLPACK_CORE_MATH_RANGE_SERIALIZATION_HPP -#define MLPACK_CORE_MATH_RANGE_SERIALIZATION_HPP - -#include "range.hpp" -#include - -namespace mlpack { -namespace math { - -//! Serialize the range. -template -template -void RangeType::Serialize(Archive& ar, const unsigned int /* version */) -{ - ar & data::CreateNVP(hi, "hi"); - ar & data::CreateNVP(lo, "lo"); -} - -} // namespace math -} // namespace mlpack - -#endif From 47a3b3df5b9e71555036dbbefcab41da83ef2c1e Mon Sep 17 00:00:00 2001 From: Sebastian Brodehl Date: Sun, 7 Jan 2018 12:40:42 +0100 Subject: [PATCH 4/7] MVU does not work. See #189. --- src/mlpack/methods/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mlpack/methods/CMakeLists.txt b/src/mlpack/methods/CMakeLists.txt index 26b771cce2..7921453cbc 100644 --- a/src/mlpack/methods/CMakeLists.txt +++ b/src/mlpack/methods/CMakeLists.txt @@ -45,7 +45,7 @@ set(DIRS local_coordinate_coding logistic_regression lsh - mvu + # mvu # Note: this implementation of MVU does not work. See #189. matrix_completion naive_bayes nca From ee0109bf36873519407c34b1b1c0323e049aefc5 Mon Sep 17 00:00:00 2001 From: Sebastian Brodehl Date: Tue, 16 Jan 2018 15:08:33 +0100 Subject: [PATCH 5/7] Rename to lower case. --- src/mlpack/methods/amf/termination_policies/CMakeLists.txt | 2 +- ...ion_RMSE_termination.hpp => validation_rmse_termination.hpp} | 0 src/mlpack/tests/svd_batch_test.cpp | 2 +- src/mlpack/tests/svd_incremental_test.cpp | 2 +- 4 files changed, 3 insertions(+), 3 deletions(-) rename src/mlpack/methods/amf/termination_policies/{validation_RMSE_termination.hpp => validation_rmse_termination.hpp} (100%) diff --git a/src/mlpack/methods/amf/termination_policies/CMakeLists.txt b/src/mlpack/methods/amf/termination_policies/CMakeLists.txt index 1538884124..4471d8a307 100644 --- a/src/mlpack/methods/amf/termination_policies/CMakeLists.txt +++ b/src/mlpack/methods/amf/termination_policies/CMakeLists.txt @@ -3,7 +3,7 @@ set(SOURCES simple_residue_termination.hpp simple_tolerance_termination.hpp - validation_RMSE_termination.hpp + validation_rmse_termination.hpp incomplete_incremental_termination.hpp complete_incremental_termination.hpp max_iteration_termination.hpp diff --git a/src/mlpack/methods/amf/termination_policies/validation_RMSE_termination.hpp b/src/mlpack/methods/amf/termination_policies/validation_rmse_termination.hpp similarity index 100% rename from src/mlpack/methods/amf/termination_policies/validation_RMSE_termination.hpp rename to src/mlpack/methods/amf/termination_policies/validation_rmse_termination.hpp diff --git a/src/mlpack/tests/svd_batch_test.cpp b/src/mlpack/tests/svd_batch_test.cpp index e926e810c4..f33690b7ab 100644 --- a/src/mlpack/tests/svd_batch_test.cpp +++ b/src/mlpack/tests/svd_batch_test.cpp @@ -14,7 +14,7 @@ #include #include #include -#include +#include #include #include diff --git a/src/mlpack/tests/svd_incremental_test.cpp b/src/mlpack/tests/svd_incremental_test.cpp index d13710243c..2400534b33 100644 --- a/src/mlpack/tests/svd_incremental_test.cpp +++ b/src/mlpack/tests/svd_incremental_test.cpp @@ -18,7 +18,7 @@ #include #include #include -#include +#include #include #include "test_tools.hpp" From 7b1ce7c2091384d3ccde9e270fe75741fddbad4f Mon Sep 17 00:00:00 2001 From: Sebastian Brodehl Date: Tue, 16 Jan 2018 15:09:06 +0100 Subject: [PATCH 6/7] Remove files from project. --- src/mlpack/core/util/CMakeLists.txt | 2 - src/mlpack/core/util/param_data_impl.hpp | 127 ----------------------- 2 files changed, 129 deletions(-) delete mode 100644 src/mlpack/core/util/param_data_impl.hpp diff --git a/src/mlpack/core/util/CMakeLists.txt b/src/mlpack/core/util/CMakeLists.txt index d3d3071978..4e35b49533 100644 --- a/src/mlpack/core/util/CMakeLists.txt +++ b/src/mlpack/core/util/CMakeLists.txt @@ -12,7 +12,6 @@ set(SOURCES cli_deleter.cpp cli_impl.hpp deprecated.hpp - gitversion.hpp hyphenate_string.hpp is_std_vector.hpp log.hpp @@ -23,7 +22,6 @@ set(SOURCES param_checks.hpp param_checks_impl.hpp param_data.hpp - param_data_impl.hpp prefixedoutstream.hpp prefixedoutstream.cpp prefixedoutstream_impl.hpp diff --git a/src/mlpack/core/util/param_data_impl.hpp b/src/mlpack/core/util/param_data_impl.hpp deleted file mode 100644 index db8d4d497e..0000000000 --- a/src/mlpack/core/util/param_data_impl.hpp +++ /dev/null @@ -1,127 +0,0 @@ -/** - * @file param_data_impl.hpp - * @author Ryan Curtin - * - * Implementation of utility functions for ParamData structures. - */ -#ifndef MLPACK_CORE_UTIL_PARAM_DATA_IMPL_HPP -#define MLPACK_CORE_UTIL_PARAM_DATA_IMPL_HPP - -#include "param_data.hpp" -#include - -namespace mlpack { -namespace util { - -//! This overload is called when nothing special needs to happen to the name of -//! the parameter. -template -std::string MapParameterName( - const std::string& identifier, - const typename boost::disable_if>::type* /* junk */, - const typename boost::disable_if>::type* /* junk */, - const typename boost::disable_if>>::type* /* junk */) -{ - return identifier; -} - -//! This is called for matrices, DatasetInfo objects, and serializable objects, -//! which have a different boost name. -template -std::string MapParameterName( - const std::string& identifier, - const typename boost::enable_if_c< - arma::is_arma_type::value || - std::is_same>::value || - data::HasSerialize::value>::type* /* junk */) -{ - return identifier + "_file"; -} - -//! This overload is called when T == ParameterType::value. -template -T& HandleParameter( - typename ParameterType::type& value, - ParamData& /* d */, - const typename boost::disable_if>::type* /* junk */, - const typename boost::disable_if>::type* /* junk */, - const typename boost::disable_if>>::type* /* junk */) -{ - return value; -} - -//! This overload is called for matrices, which return a different type. -template -T& HandleParameter( - typename ParameterType::type& value, - ParamData& d, - const typename boost::enable_if>::type* /* junk */) -{ - // If the matrix is an input matrix, we have to load the matrix. 'value' - // contains the filename. It's possible we could load empty matrices many - // times, but I am not bothered by that---it shouldn't be something that - // happens. - T& matrix = *boost::any_cast(&d.mappedValue); - if (d.input && !d.loaded) - { - // call correct data::Load() function - if (arma::is_Row::value || arma::is_Col::value) - data::Load(value, matrix, true); - else - data::Load(value, matrix, true, !d.noTranspose); - d.loaded = true; - } - - return matrix; -} - -//! This must be overloaded for matrices and dataset info objects. -template -T& HandleParameter( - typename util::ParameterType::type& value, - util::ParamData& d, - const typename boost::enable_if>>::type* /* junk */) -{ - // If this is an input parameter, we need to load both the matrix and the - // dataset info. - std::tuple& tuple = - *boost::any_cast>(&d.mappedValue); - if (d.input && !d.loaded) - { - data::Load(value, std::get<1>(tuple), std::get<0>(tuple), true, - !d.noTranspose); - d.loaded = true; - } - - return tuple; -} - -//! This is called for serializable mlpack objects, which have a different boost -//! name. -template -T& HandleParameter( - typename ParameterType::type& value, - ParamData& d, - const typename boost::enable_if>::type* /* junk */) -{ - // If the model is an input model, we have to load it from file. 'value' - // contains the filename. - T& model = *boost::any_cast(&d.mappedValue); - if (d.input && !d.loaded) - { - data::Load(value, "model", model, true); - d.loaded = true; - } - - return model; -} - -} // namespace util -} // namespace mlpack - -#endif From 5ef3e9d89aa2ba33cfb6c9f7ce03d19df3bfe1d0 Mon Sep 17 00:00:00 2001 From: Sebastian Brodehl Date: Tue, 16 Jan 2018 22:38:12 +0100 Subject: [PATCH 7/7] Sort lines. --- src/mlpack/methods/CMakeLists.txt | 12 ++++++------ src/mlpack/tests/CMakeLists.txt | 28 ++++++++++++++-------------- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/src/mlpack/methods/CMakeLists.txt b/src/mlpack/methods/CMakeLists.txt index 7921453cbc..4e6fc3df98 100644 --- a/src/mlpack/methods/CMakeLists.txt +++ b/src/mlpack/methods/CMakeLists.txt @@ -21,11 +21,11 @@ endmacro () # Recurse into each method mlpack provides. set(DIRS - preprocess + # mvu # Note: this implementation of MVU does not work. See #189. adaboost - approx_kfn amf ann + approx_kfn block_krylov_svd cf dbscan @@ -39,24 +39,25 @@ set(DIRS hoeffding_trees kernel_pca kmeans - mean_shift lars linear_regression local_coordinate_coding logistic_regression lsh - # mvu # Note: this implementation of MVU does not work. See #189. matrix_completion + mean_shift naive_bayes nca neighbor_search nmf + nystroem_method pca perceptron + preprocess quic_svd radical - randomized_svd random_forest + randomized_svd range_search rann regularized_svd @@ -65,7 +66,6 @@ set(DIRS sparse_autoencoder sparse_coding sparse_svm - nystroem_method ) foreach(dir ${DIRS}) diff --git a/src/mlpack/tests/CMakeLists.txt b/src/mlpack/tests/CMakeLists.txt index 459c4e437b..5924f154c6 100644 --- a/src/mlpack/tests/CMakeLists.txt +++ b/src/mlpack/tests/CMakeLists.txt @@ -1,27 +1,27 @@ # mlpack test executable. add_executable(mlpack_test activation_functions_test.cpp - adaboost_test.cpp - adam_test.cpp ada_delta_test.cpp ada_grad_test.cpp + adaboost_test.cpp + adam_test.cpp akfn_test.cpp aknn_test.cpp ann_layer_test.cpp - armadillo_svd_test.cpp arma_extend_test.cpp + armadillo_svd_test.cpp async_learning_test.cpp aug_lagrangian_test.cpp augmented_rnns_tasks_test.cpp binarize_test.cpp block_krylov_svd_test.cpp cf_test.cpp + cli_binding_test.cpp cli_test.cpp cmaes_test.cpp - cli_binding_test.cpp cne_test.cpp - convolutional_network_test.cpp convolution_test.cpp + convolutional_network_test.cpp cosine_tree_test.cpp cv_test.cpp dbscan_test.cpp @@ -55,14 +55,17 @@ add_executable(mlpack_test lars_test.cpp lbfgs_test.cpp lin_alg_test.cpp - linear_regression_test.cpp line_search_test.cpp + linear_regression_test.cpp load_save_test.cpp local_coordinate_coding_test.cpp - logistic_regression_test.cpp log_test.cpp + logistic_regression_test.cpp lrsdp_test.cpp lsh_test.cpp + main_tests/emst_test.cpp + main_tests/linear_regression_test.cpp + main_tests/pca_test.cpp math_test.cpp matrix_completion_test.cpp maximal_inputs_test.cpp @@ -79,9 +82,9 @@ add_executable(mlpack_test parallel_sgd_test.cpp pca_test.cpp perceptron_test.cpp - python_binding_test.cpp prefixedoutstream_test.cpp proximal_test.cpp + python_binding_test.cpp q_learning_test.cpp qdafn_test.cpp quic_svd_test.cpp @@ -98,12 +101,12 @@ add_executable(mlpack_test sa_test.cpp scd_test.cpp sdp_primal_dual_test.cpp - serialization.hpp serialization.cpp + serialization.hpp serialization_test.cpp - sgdr_test.cpp - sgd_test.cpp sfinae_test.cpp + sgd_test.cpp + sgdr_test.cpp smorms3_test.cpp snapshot_ensembles.cpp softmax_regression_test.cpp @@ -123,9 +126,6 @@ add_executable(mlpack_test ub_tree_test.cpp union_find_test.cpp vantage_point_tree_test.cpp - main_tests/emst_test.cpp - main_tests/linear_regression_test.cpp - main_tests/pca_test.cpp ) # Link dependencies of test executable.