13 #ifndef MLPACK_BINDINGS_GO_PRINT_OUTPUT_PROCESSING_HPP 14 #define MLPACK_BINDINGS_GO_PRINT_OUTPUT_PROCESSING_HPP 32 const typename std::enable_if<!arma::is_arma_type<T>::value>::type* = 0,
34 const typename std::enable_if<!std::is_same<T,
35 std::tuple<data::DatasetInfo, arma::mat>>::value>::type* = 0)
37 const std::string prefix(indent,
' ');
46 std::string name = d.
name;
48 std::cout << prefix << name <<
" := getParam" << GetType<T>(d)
49 <<
"(params, \"" << d.
name <<
"\")" << std::endl;
59 const typename std::enable_if<arma::is_arma_type<T>::value>::type* = 0,
60 const typename std::enable_if<!std::is_same<T,
61 std::tuple<data::DatasetInfo, arma::mat>>::value>::type* = 0)
63 const std::string prefix(indent,
' ');
73 std::string name = d.
name;
75 std::cout << prefix <<
"var " << name <<
"Ptr mlpackArma" << std::endl;
76 std::cout << prefix << name <<
" := " << name
77 <<
"Ptr.armaToGonum" << GetType<T>(d)
78 <<
"(params, \"" << d.
name <<
"\")" << std::endl;
87 const typename std::enable_if<std::is_same<T,
88 std::tuple<data::DatasetInfo, arma::mat>>::value>::type* = 0)
90 const std::string prefix(indent,
' ');
100 std::string name = d.
name;
102 std::cout << prefix <<
"var " << name <<
"Ptr mlpackArma" << std::endl;
103 std::cout << prefix << name <<
" := " << name <<
"Ptr.armaToGonumWith" 104 <<
"Info(params, \"" << d.
name <<
"\")" << std::endl;
114 const typename std::enable_if<!arma::is_arma_type<T>::value>::type* = 0,
118 std::string goStrippedType, strippedType, printedType, defaultsType;
119 StripType(d.
cppType, goStrippedType, strippedType, printedType, defaultsType);
121 const std::string prefix(indent,
' ');
130 std::string name = d.
name;
132 std::cout << prefix <<
"var " << name <<
" " << goStrippedType << std::endl;
133 std::cout << prefix << name <<
".get" << strippedType
134 <<
"(params, \"" << d.
name <<
"\")" << std::endl;
147 PrintOutputProcessing<typename std::remove_pointer<T>::type>(d, 2);
void StripType(const std::string &inputType, std::string &goStrippedType, std::string &strippedType, std::string &printedType, std::string &defaultsType)
Given an input type like, e.g., "LogisticRegression<>", return four types that can be used in Go code...
Linear algebra utility functions, generally performed on matrices or vectors.
The core includes that mlpack expects; standard C++ includes and Armadillo.
This structure holds all of the information about a single parameter, including its value (which is s...
std::string CamelCase(std::string s, bool lower)
Given an snake_case like, e.g., "logistic_regression", return CamelCase(e.g.
std::string name
Name of this parameter.
std::string cppType
The true name of the type, as it would be written in C++.
void PrintOutputProcessing(util::ParamData &d, const size_t indent, const typename std::enable_if<!arma::is_arma_type< T >::value >::type *=0, const typename std::enable_if<!data::HasSerialize< T >::value >::type *=0, const typename std::enable_if<!std::is_same< T, std::tuple< data::DatasetInfo, arma::mat >>::value >::type *=0)
Print output processing for a regular parameter type.