mlpack  3.1.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  const 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  const util::ParamData& data,
42  const typename boost::enable_if<util::IsStdVector<T>>::type* = 0);
43 
47 template<typename T>
48 std::string DefaultParamImpl(
49  const 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  const 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  const 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>
80 void DefaultParam(const util::ParamData& data,
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
MLPACK_VERSION_MAJOR
#define MLPACK_VERSION_MAJOR
Definition: version.hpp:19
prereqs.hpp
mlpack::data::format
format
Define the formats we can read through boost::serialization.
Definition: format.hpp:20
else
not building Python bindings else() message(STATUS "Found Python
Definition: CMakeLists.txt:20
include_directories
include_directories(${CMAKE_CURRENT_BINARY_DIR}/..) set(MLPACK_SRCS $
Definition: CMakeLists.txt:1
is_std_vector.hpp
mlpack::bindings::cli::DefaultParamImpl
std::string DefaultParamImpl(const 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.
BINDING_TYPE_MARKDOWN
#define BINDING_TYPE_MARKDOWN
Definition: mlpack_main.hpp:24
mlpack::util::ParamData
This structure holds all of the information about a single parameter, including its value (which is s...
Definition: param_data.hpp:52
mlpack
@serialization.hpp
Definition: add_to_po.hpp:21
add_subdirectory
add_subdirectory(${dir}) endforeach() set(MARKDOWN_CATEGORIES $
Definition: CMakeLists.txt:10
BINDING_TYPE_CLI
#define BINDING_TYPE_CLI
Definition: mlpack_main.hpp:21
MLPACK_VERSION_MINOR
#define MLPACK_VERSION_MINOR
Definition: version.hpp:20
MLPACK_VERSION_PATCH
#define MLPACK_VERSION_PATCH
Definition: version.hpp:21
mlpack::bindings::cli::DefaultParam
void DefaultParam(const util::ParamData &data, const void *, void *output)
Return the default value of an option.
Definition: default_param.hpp:80
set
set(SOURCES add_to_po.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 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
BINDING_TYPE_PYX
#define BINDING_TYPE_PYX
Definition: mlpack_main.hpp:23
endif
endif() include($
Definition: CMakeLists.txt:22
BINDING_TYPE
#define BINDING_TYPE
Definition: mlpack_main.hpp:28
add_cli_executable
add_cli_executable(nmf) add_python_binding(nmf) add_markdown_docs(nmf "cli
param_data.hpp
add_executable
add_executable(mlpack_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 arma_extend_test.cpp armadillo_svd_test.cpp async_learning_test.cpp augmented_rnns_tasks_test.cpp bias_svd_test.cpp binarize_test.cpp block_krylov_svd_test.cpp callback_test.cpp cf_test.cpp cli_binding_test.cpp cli_test.cpp convolution_test.cpp convolutional_network_test.cpp cosine_tree_test.cpp cv_test.cpp dbscan_test.cpp dcgan_test.cpp decision_stump_test.cpp decision_tree_test.cpp det_test.cpp distribution_test.cpp drusilla_select_test.cpp emst_test.cpp fastmks_test.cpp feedforward_network_test.cpp gan_test.cpp gmm_test.cpp hmm_test.cpp hoeffding_tree_test.cpp hpt_test.cpp hyperplane_test.cpp image_load_test.cpp imputation_test.cpp init_rules_test.cpp kde_test.cpp kernel_pca_test.cpp kernel_test.cpp kernel_traits_test.cpp kfn_test.cpp kmeans_test.cpp knn_test.cpp krann_search_test.cpp ksinit_test.cpp lars_test.cpp layer_names_test.cpp lin_alg_test.cpp linear_regression_test.cpp linear_svm_test.cpp lmnn_test.cpp load_save_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 nca_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 quic_svd_test.cpp radical_test.cpp random_forest_test.cpp random_test.cpp randomized_svd_test.cpp range_search_test.cpp rbm_network_test.cpp rectangle_tree_test.cpp recurrent_network_test.cpp regularized_svd_test.cpp reward_clipping_test.cpp rl_components_test.cpp serialization.cpp serialization.hpp serialization_test.cpp sfinae_test.cpp softmax_regression_test.cpp sort_policy_test.cpp sparse_autoencoder_test.cpp sparse_coding_test.cpp spill_tree_test.cpp split_data_test.cpp sumtree_test.cpp svd_batch_test.cpp svd_incremental_test.cpp svdplusplus_test.cpp termination_policy_test.cpp test_function_tools.hpp test_tools.hpp timer_test.cpp tree_test.cpp tree_traits_test.cpp scaling_test.cpp ub_tree_test.cpp union_find_test.cpp vantage_point_tree_test.cpp wgan_test.cpp main_tests/test_helper.hpp main_tests/emst_test.cpp main_tests/adaboost_test.cpp main_tests/approx_kfn_test.cpp main_tests/cf_test.cpp main_tests/dbscan_test.cpp main_tests/det_test.cpp main_tests/decision_tree_test.cpp main_tests/decision_stump_test.cpp main_tests/gmm_generate_test.cpp main_tests/gmm_probability_test.cpp main_tests/gmm_train_test.cpp main_tests/fastmks_test.cpp main_tests/kde_test.cpp main_tests/kfn_test.cpp main_tests/knn_test.cpp main_tests/linear_regression_test.cpp main_tests/linear_svm_test.cpp main_tests/logistic_regression_test.cpp main_tests/local_coordinate_coding_test.cpp main_tests/lmnn_test.cpp main_tests/lsh_test.cpp main_tests/mean_shift_test.cpp main_tests/nbc_test.cpp main_tests/nca_test.cpp main_tests/nmf_test.cpp main_tests/pca_test.cpp main_tests/perceptron_test.cpp main_tests/preprocess_binarize_test.cpp main_tests/preprocess_scale_test.cpp main_tests/preprocess_imputer_test.cpp main_tests/preprocess_split_test.cpp main_tests/random_forest_test.cpp main_tests/softmax_regression_test.cpp main_tests/sparse_coding_test.cpp main_tests/kmeans_test.cpp main_tests/hoeffding_tree_test.cpp main_tests/hmm_viterbi_test.cpp main_tests/hmm_train_test.cpp main_tests/hmm_loglik_test.cpp main_tests/hmm_generate_test.cpp main_tests/radical_test.cpp main_tests/hmm_test_utils.hpp main_tests/kernel_pca_test.cpp main_tests/range_search_test.cpp) target_link_libraries(mlpack_test mlpack $
Definition: CMakeLists.txt:2
mlpack::data::DatasetMapper
Auxiliary information for a dataset, including mappings to/from strings (or other types) and the data...
Definition: dataset_mapper.hpp:41