12 #ifndef MLPACK_BINDINGS_PYTHON_GET_PRINTABLE_PARAM_HPP 13 #define MLPACK_BINDINGS_PYTHON_GET_PRINTABLE_PARAM_HPP 26 std::string GetPrintableParam(
28 const typename std::enable_if<!arma::is_arma_type<T>::value>::type* = 0,
31 const typename std::enable_if<!std::is_same<T,
32 std::tuple<data::DatasetInfo, arma::mat>>::value>::type* = 0)
34 std::ostringstream oss;
35 oss << boost::any_cast<T>(data.
value);
43 std::string GetPrintableParam(
47 const T& t = boost::any_cast<T>(data.
value);
49 std::ostringstream oss;
50 for (
size_t i = 0; i < t.size(); ++i)
59 std::string GetPrintableParam(
61 const typename std::enable_if<arma::is_arma_type<T>::value>::type* = 0)
64 const T& matrix = boost::any_cast<T>(data.
value);
66 std::ostringstream oss;
67 oss << matrix.n_rows <<
"x" << matrix.n_cols <<
" matrix";
75 std::string GetPrintableParam(
77 const typename std::enable_if<!arma::is_arma_type<T>::value>::type* = 0,
80 std::ostringstream oss;
81 oss << data.
cppType <<
" model at " << boost::any_cast<T*>(data.
value);
89 std::string GetPrintableParam(
91 const typename std::enable_if<std::is_same<T,
92 std::tuple<data::DatasetInfo, arma::mat>>::value>::type* = 0)
95 const T& tuple = boost::any_cast<T>(data.
value);
96 const arma::mat& matrix = std::get<1>(tuple);
98 std::ostringstream oss;
99 oss << matrix.n_rows <<
"x" << matrix.n_cols <<
" matrix with dimension type " 118 *((std::string*) output) =
119 GetPrintableParam<typename std::remove_pointer<T>::type>(data);
Definition: has_serialize.hpp:47
Linear algebra utility functions, generally performed on matrices or vectors.
Definition: cv.hpp:1
The core includes that mlpack expects; standard C++ includes and Armadillo.
std::string cppType
The true name of the type, as it would be written in C++.
Definition: param_data.hpp:84
This structure holds all of the information about a single parameter, including its value (which is s...
Definition: param_data.hpp:52
Metaprogramming structure for vector detection.
Definition: is_std_vector.hpp:23
boost::any value
The actual value that is held.
Definition: param_data.hpp:82