13 #ifndef MLPACK_BINDINGS_GO_PRINT_OUTPUT_PROCESSING_HPP 14 #define MLPACK_BINDINGS_GO_PRINT_OUTPUT_PROCESSING_HPP 32 const typename boost::disable_if<arma::is_arma_type<T>>::type* = 0,
34 const typename boost::disable_if<std::is_same<T,
35 std::tuple<data::DatasetInfo, arma::mat>>>::type* = 0)
37 const std::string prefix(indent,
' ');
46 std::string name = d.
name;
48 std::cout << prefix << name <<
" := getParam" << GetType<T>(d)
49 <<
"(\"" << d.
name <<
"\")" << std::endl;
59 const typename boost::enable_if<arma::is_arma_type<T>>::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,
' ');
72 std::string name = d.
name;
75 name[0] = std::tolower(name[0]);
76 std::cout << prefix <<
"var " << name <<
"Ptr mlpackArma" << std::endl;
77 std::cout << prefix << dname <<
" := " << name
78 <<
"Ptr.armaToGonum" << GetType<T>(d)
79 <<
"(\"" << d.
name <<
"\")" << std::endl;
88 const typename boost::enable_if<std::is_same<T,
89 std::tuple<data::DatasetInfo, arma::mat>>>::type* = 0)
91 const std::string prefix(indent,
' ');
100 std::string name = d.
name;
103 name[0] = std::tolower(name[0]);
104 std::cout << prefix <<
"var " << name <<
"Ptr mlpackArma" << std::endl;
105 std::cout << prefix << dname <<
" := " << name <<
"Ptr.armaToGonumWith" 106 <<
"Info(\"" << d.
name <<
"\")" << std::endl;
116 const typename boost::disable_if<arma::is_arma_type<T>>::type* = 0,
120 std::string goStrippedType, strippedType, printedType, defaultsType;
121 StripType(d.
cppType, goStrippedType, strippedType, printedType, defaultsType);
123 const std::string prefix(indent,
' ');
133 std::string name = d.
name;
135 std::cout << prefix <<
"var " << name <<
" " << goStrippedType << std::endl;
136 std::cout << prefix << name <<
".get" << strippedType
137 <<
"(\"" << d.
name <<
"\")" << std::endl;
150 PrintOutputProcessing<typename std::remove_pointer<T>::type>(d, 2);
std::string CamelCase(std::string s)
Given an snake_case like, e.g., "logistic_regression", return CamelCase(e.g.
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...
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...
void PrintOutputProcessing(const util::ParamData &d, const size_t indent, 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< data::DatasetInfo, arma::mat >>>::type *=0)
Print output processing for a regular parameter type.
std::string name
Name of this parameter.
std::string cppType
The true name of the type, as it would be written in C++.