12 #ifndef MLPACK_BINDINGS_CLI_GET_PARAM_HPP 13 #define MLPACK_BINDINGS_CLI_GET_PARAM_HPP 31 const typename boost::disable_if<arma::is_arma_type<T>>::type* = 0,
33 const typename boost::disable_if<std::is_same<T,
34 std::tuple<mlpack::data::DatasetInfo, arma::mat>>>::type* = 0)
37 return *boost::any_cast<T>(&d.
value);
48 const typename boost::enable_if<arma::is_arma_type<T>>::type* = 0)
54 typedef std::tuple<T, typename ParameterType<T>::type> TupleType;
55 TupleType& tuple = *boost::any_cast<TupleType>(&d.
value);
56 const std::string& value = std::get<1>(tuple);
57 T& matrix = std::get<0>(tuple);
61 if (arma::is_Row<T>::value || arma::is_Col<T>::value)
79 const typename boost::enable_if<std::is_same<T,
80 std::tuple<mlpack::data::DatasetInfo, arma::mat>>>::type* = 0)
84 typedef std::tuple<T, std::string> TupleType;
85 TupleType* tuple = boost::any_cast<TupleType>(&d.
value);
86 const std::string& value = std::get<1>(*tuple);
87 T& t = std::get<0>(*tuple);
105 const typename boost::disable_if<arma::is_arma_type<T>>::type* = 0,
110 typedef std::tuple<T*, std::string> TupleType;
111 TupleType* tuple = boost::any_cast<TupleType>(&d.
value);
112 const std::string& value = std::get<1>(*tuple);
118 std::get<0>(*tuple) = model;
120 return std::get<0>(*tuple);
135 *((T**) output) = &GetParam<typename std::remove_pointer<T>::type>(
boost::any value
The actual value that is held.
Linear algebra utility functions, generally performed on matrices or vectors.
The core includes that mlpack expects; standard C++ includes and Armadillo.
bool input
True if this option is an input option (otherwise, it is output).
This structure holds all of the information about a single parameter, including its value (which is s...
bool loaded
If this is an input parameter that needs extra loading, this indicates whether or not it has been loa...
bool Load(const std::string &filename, arma::Mat< eT > &matrix, const bool fatal=false, const bool transpose=true)
Loads a matrix from file, guessing the filetype from the extension.
T & GetParam(util::ParamData &d, const typename boost::disable_if< arma::is_arma_type< T >>::type *=0, const typename boost::disable_if< data::HasSerialize< T >>::type *=0, const typename boost::disable_if< std::is_same< T, std::tuple< mlpack::data::DatasetInfo, arma::mat >>>::type *=0)
This overload is called when nothing special needs to happen to the name of the parameter.
bool noTranspose
True if this is a matrix that should not be transposed.