mlpack  3.4.1
default_param.hpp
Go to the documentation of this file.
1 
12 #ifndef MLPACK_BINDINGS_CLI_DEFAULT_PARAM_HPP
13 #define MLPACK_BINDINGS_CLI_DEFAULT_PARAM_HPP
14 
15 #include <mlpack/prereqs.hpp>
18 
19 namespace mlpack {
20 namespace bindings {
21 namespace cli {
22 
26 template<typename T>
27 std::string DefaultParamImpl(
28  util::ParamData& data,
29  const typename boost::disable_if<arma::is_arma_type<T>>::type* = 0,
30  const typename boost::disable_if<util::IsStdVector<T>>::type* = 0,
31  const typename boost::disable_if<data::HasSerialize<T>>::type* = 0,
32  const typename boost::disable_if<std::is_same<T, std::string>>::type* = 0,
33  const typename boost::disable_if<std::is_same<T,
34  std::tuple<mlpack::data::DatasetInfo, arma::mat>>>::type* = 0);
35 
39 template<typename T>
40 std::string DefaultParamImpl(
41  util::ParamData& data,
42  const typename boost::enable_if<util::IsStdVector<T>>::type* = 0);
43 
47 template<typename T>
48 std::string DefaultParamImpl(
49  util::ParamData& data,
50  const typename boost::enable_if<std::is_same<T, std::string>>::type* = 0);
51 
57 template<typename T>
58 std::string DefaultParamImpl(
59  util::ParamData& data,
60  const typename boost::enable_if_c<
61  arma::is_arma_type<T>::value ||
62  std::is_same<T, std::tuple<mlpack::data::DatasetInfo,
63  arma::mat>>::value>::type* /* junk */ = 0);
64 
69 template<typename T>
70 std::string DefaultParamImpl(
71  util::ParamData& data,
72  const typename boost::disable_if<arma::is_arma_type<T>>::type* = 0,
73  const typename boost::enable_if<data::HasSerialize<T>>::type* = 0);
74 
79 template<typename T>
81  const void* /* input */,
82  void* output)
83 {
84  std::string* outstr = (std::string*) output;
85  *outstr = DefaultParamImpl<typename std::remove_pointer<T>::type>(data);
86 }
87 
88 } // namespace cli
89 } // namespace bindings
90 } // namespace mlpack
91 
92 // Include implementation.
93 #include "default_param_impl.hpp"
94 
95 #endif
macro
macro(not_found_return message) message(STATUS "$
Definition: CMakeLists.txt:1
include
include(${CMAKE_SOURCE_DIR}/CMake/FindRModule.cmake) find_package(R 4.0) if(NOT R_FOUND) set(R_NOT_FOUND_MSG "$
Definition: CMakeLists.txt:28
MLPACK_VERSION_MAJOR
#define MLPACK_VERSION_MAJOR
Definition: version.hpp:19
prereqs.hpp
The core includes that mlpack expects; standard C++ includes and Armadillo.
mlpack::data::format
format
Define the formats we can read through boost::serialization.
Definition: format.hpp:21
include_directories
include_directories(${CMAKE_CURRENT_BINARY_DIR}/..) set(MLPACK_SRCS $
Definition: CMakeLists.txt:1
is_std_vector.hpp
library
e library(pkgload)
mlpack::bindings::cli::DefaultParamImpl
std::string DefaultParamImpl(util::ParamData &data, const typename boost::disable_if< arma::is_arma_type< T >>::type *=0, const typename boost::disable_if< util::IsStdVector< T >>::type *=0, const typename boost::disable_if< data::HasSerialize< T >>::type *=0, const typename boost::disable_if< std::is_same< T, std::string >>::type *=0, const typename boost::disable_if< std::is_same< T, std::tuple< mlpack::data::DatasetInfo, arma::mat >>>::type *=0)
Return the default value of an option.
add_julia_binding
add_julia_binding(test_julia_binding) add_test(NAME julia_binding_test COMMAND $
Definition: CMakeLists.txt:2
boost
Set the serialization version of the adaboost class.
Definition: adaboost.hpp:198
mlpack::bindings::cli::DefaultParam
void DefaultParam(util::ParamData &data, const void *, void *output)
Return the default value of an option.
Definition: default_param.hpp:80
BINDING_TYPE_JL
#define BINDING_TYPE_JL
Definition: mlpack_main.hpp:24
BINDING_TYPE_MARKDOWN
#define BINDING_TYPE_MARKDOWN
Definition: mlpack_main.hpp:27
find_package
CMake FindPythonModule cmake find_package(PythonInterp) if(NOT PYTHON_EXECUTABLE) set(PY_NOT_FOUND_MSG "$
Definition: CMakeLists.txt:19
mlpack::util::ParamData
This structure holds all of the information about a single parameter, including its value (which is s...
Definition: param_data.hpp:53
mlpack
Linear algebra utility functions, generally performed on matrices or vectors.
Definition: add_to_cli11.hpp:21
add_subdirectory
add_subdirectory(${dir}) endforeach() set(MARKDOWN_CATEGORIES $
Definition: CMakeLists.txt:13
julia
julia
Definition: CMakeLists.txt:6
mlpack::util::IsStdVector
Metaprogramming structure for vector detection.
Definition: is_std_vector.hpp:23
BINDING_TYPE_CLI
#define BINDING_TYPE_CLI
Definition: mlpack_main.hpp:21
if
if(NOT BUILD_GO_SHLIB) macro(add_go_binding name) endmacro() return() endif() endmacro() if(NOT BUILD_GO_BINDINGS) not_found_return("Not building Go bindings.") endif() if(BUILD_GO_BINDINGS) find_package(Go 1.11.0) if(NOT GO_FOUND) set(GO_NOT_FOUND_MSG "$
Definition: CMakeLists.txt:3
MLPACK_VERSION_MINOR
#define MLPACK_VERSION_MINOR
Definition: version.hpp:20
MLPACK_VERSION_PATCH
#define MLPACK_VERSION_PATCH
Definition: version.hpp:21
add_go_binding
add_go_binding(test_go_binding) if(BUILD_GO_BINDINGS) add_test(NAME go_binding_test COMMAND $
Definition: CMakeLists.txt:2
available
the following modules are not available
Definition: CMakeLists.txt:42
add_cli_executable
add_cli_executable(nmf) add_python_binding(nmf) add_julia_binding(nmf) add_go_binding(nmf) add_r_binding(nmf) add_markdown_docs(nmf "cli
BINDING_TYPE_PYX
#define BINDING_TYPE_PYX
Definition: mlpack_main.hpp:23
set
set(SOURCES add_to_cli11.hpp cli_option.hpp default_param.hpp default_param_impl.hpp delete_allocated_memory.hpp end_program.hpp get_allocated_memory.hpp get_param.hpp get_raw_param.hpp get_printable_param.hpp get_printable_param_impl.hpp get_printable_param_name.hpp get_printable_param_name_impl.hpp get_printable_param_value.hpp get_printable_param_value_impl.hpp in_place_copy.hpp map_parameter_name.hpp output_param.hpp output_param_impl.hpp parameter_type.hpp parse_command_line.hpp print_doc_functions.hpp print_doc_functions_impl.hpp print_help.hpp print_help.cpp print_type_doc.hpp print_type_doc_impl.hpp set_param.hpp string_type_param.hpp string_type_param_impl.hpp) set(DIR_SRCS) foreach(file $
Definition: CMakeLists.txt:3
endif
n Go endif() find_package(Gonum) if(NOT GONUM_FOUND) set(GO_NOT_FOUND_MSG "$
Definition: CMakeLists.txt:23
BINDING_TYPE
#define BINDING_TYPE
Definition: mlpack_main.hpp:31
mlpack::data::HasSerialize
Definition: has_serialize.hpp:46
add_executable
add_executable(mlpack_test arma_extend_test.cpp async_learning_test.cpp augmented_rnns_tasks_test.cpp callback_test.cpp cf_test.cpp cli_binding_test.cpp io_test.cpp cosine_tree_test.cpp dbscan_test.cpp dcgan_test.cpp det_test.cpp distribution_test.cpp drusilla_select_test.cpp emst_test.cpp fastmks_test.cpp facilities_test.cpp gan_test.cpp gmm_test.cpp hmm_test.cpp hoeffding_tree_test.cpp hpt_test.cpp hyperplane_test.cpp init_rules_test.cpp kde_test.cpp krann_search_test.cpp ksinit_test.cpp lars_test.cpp layer_names_test.cpp lin_alg_test.cpp linear_svm_test.cpp lmnn_test.cpp local_coordinate_coding_test.cpp log_test.cpp logistic_regression_test.cpp loss_functions_test.cpp lsh_test.cpp math_test.cpp matrix_completion_test.cpp maximal_inputs_test.cpp mean_shift_test.cpp metric_test.cpp mlpack_test.cpp mock_categorical_data.hpp nbc_test.cpp nmf_test.cpp nystroem_method_test.cpp octree_test.cpp pca_test.cpp perceptron_test.cpp prefixedoutstream_test.cpp python_binding_test.cpp q_learning_test.cpp qdafn_test.cpp radical_test.cpp random_forest_test.cpp random_test.cpp range_search_test.cpp rectangle_tree_test.cpp reward_clipping_test.cpp rl_components_test.cpp serialization.cpp serialization.hpp serialization_test.cpp sfinae_test.cpp sort_policy_test.cpp spill_tree_test.cpp string_encoding_test.cpp sumtree_test.cpp termination_policy_test.cpp test_function_tools.hpp test_tools.hpp timer_test.cpp tree_test.cpp tree_traits_test.cpp ub_tree_test.cpp union_find_test.cpp vantage_point_tree_test.cpp wgan_test.cpp main_tests/cf_test.cpp main_tests/dbscan_test.cpp main_tests/det_test.cpp main_tests/emst_test.cpp main_tests/fastmks_test.cpp main_tests/gmm_generate_test.cpp main_tests/gmm_probability_test.cpp main_tests/gmm_train_test.cpp main_tests/hmm_generate_test.cpp main_tests/hmm_loglik_test.cpp main_tests/hmm_test_utils.hpp main_tests/hmm_train_test.cpp main_tests/hmm_viterbi_test.cpp main_tests/hoeffding_tree_test.cpp main_tests/kde_test.cpp main_tests/krann_test.cpp main_tests/linear_svm_test.cpp main_tests/lmnn_test.cpp main_tests/local_coordinate_coding_test.cpp main_tests/logistic_regression_test.cpp main_tests/lsh_test.cpp main_tests/mean_shift_test.cpp main_tests/nbc_test.cpp main_tests/nmf_test.cpp main_tests/pca_test.cpp main_tests/perceptron_test.cpp main_tests/radical_test.cpp main_tests/random_forest_test.cpp main_tests/range_search_test.cpp main_tests/test_helper.hpp) add_executable(mlpack_catch_test activation_functions_test.cpp adaboost_test.cpp akfn_test.cpp aknn_test.cpp ann_dist_test.cpp ann_layer_test.cpp ann_regularizer_test.cpp ann_test_tools.hpp ann_visitor_test.cpp armadillo_svd_test.cpp bayesian_linear_regression_test.cpp bias_svd_test.cpp binarize_test.cpp block_krylov_svd_test.cpp convolutional_network_test.cpp convolution_test.cpp cv_test.cpp decision_stump_test.cpp decision_tree_test.cpp feedforward_network_test.cpp image_load_test.cpp imputation_test.cpp kernel_pca_test.cpp kernel_test.cpp kernel_traits_test.cpp kfn_test.cpp kmeans_test.cpp knn_test.cpp linear_regression_test.cpp load_save_test.cpp main.cpp nca_test.cpp one_hot_encoding_test.cpp quic_svd_test.cpp randomized_svd_test.cpp rbm_network_test.cpp recurrent_network_test.cpp regularized_svd_test.cpp scaling_test.cpp serialization_catch.cpp serialization_catch.hpp softmax_regression_test.cpp sparse_autoencoder_test.cpp sparse_coding_test.cpp split_data_test.cpp svd_batch_test.cpp svd_incremental_test.cpp svdplusplus_test.cpp test_catch_tools.hpp main_tests/adaboost_test.cpp main_tests/approx_kfn_test.cpp main_tests/bayesian_linear_regression_test.cpp main_tests/decision_stump_test.cpp main_tests/decision_tree_test.cpp main_tests/image_converter_test.cpp main_tests/kernel_pca_test.cpp main_tests/kfn_test.cpp main_tests/kmeans_test.cpp main_tests/knn_test.cpp main_tests/linear_regression_test.cpp main_tests/nca_test.cpp main_tests/preprocess_binarize_test.cpp main_tests/preprocess_imputer_test.cpp main_tests/preprocess_one_hot_encode_test.cpp main_tests/preprocess_scale_test.cpp main_tests/preprocess_split_test.cpp main_tests/softmax_regression_test.cpp main_tests/sparse_coding_test.cpp main_tests/test_helper.hpp) target_link_libraries(mlpack_test mlpack $
Definition: CMakeLists.txt:2
param_data.hpp
add_r_binding
add_r_binding(test_r_binding) add_test(NAME r_binding_test COMMAND $
Definition: CMakeLists.txt:2
python
python
Definition: CMakeLists.txt:6
go
go
Definition: CMakeLists.txt:6
mlpack::data::DatasetMapper
Auxiliary information for a dataset, including mappings to/from strings (or other types) and the data...
Definition: dataset_mapper.hpp:42