mlpack
|
#include <mlpack/prereqs.hpp>
#include "get_arma_type.hpp"
#include "get_numpy_type_char.hpp"
#include "get_cython_type.hpp"
Go to the source code of this file.
Namespaces | |
mlpack | |
Linear algebra utility functions, generally performed on matrices or vectors. | |
Functions | |
template<typename T > | |
void | mlpack::bindings::python::PrintOutputProcessing (util::ParamData &d, const size_t indent, const bool onlyOutput, 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. More... | |
template<typename T > | |
void | mlpack::bindings::python::PrintOutputProcessing (util::ParamData &d, const size_t indent, const bool onlyOutput, const typename std::enable_if< arma::is_arma_type< T >::value >::type *=0) |
Print output processing for a matrix type. More... | |
template<typename T > | |
void | mlpack::bindings::python::PrintOutputProcessing (util::ParamData &d, const size_t indent, const bool onlyOutput, const typename std::enable_if< std::is_same< T, std::tuple< data::DatasetInfo, arma::mat >>::value >::type *=0) |
Print output processing for a dataset info / matrix combination. More... | |
template<typename T > | |
void | mlpack::bindings::python::PrintOutputProcessing (util::ParamData &d, const size_t indent, const bool onlyOutput, const typename std::enable_if<!arma::is_arma_type< T >::value >::type *=0, const typename std::enable_if< data::HasSerialize< T >::value >::type *=0) |
Print output processing for a serializable model. More... | |
template<typename T > | |
void | mlpack::bindings::python::PrintOutputProcessing (util::ParamData &d, const void *input, void *) |
Given parameter information and the current number of spaces for indentation, print the code to process the output to cout. More... | |
Print the output processing in a Python binding .pyx file for a given parameter.
mlpack is free software; you may redistribute it and/or modify it under the terms of the 3-clause BSD license. You should have received a copy of the 3-clause BSD license along with mlpack. If not, see http://www.opensource.org/licenses/BSD-3-Clause for more information.
void mlpack::bindings::python::PrintOutputProcessing | ( | util::ParamData & | d, |
const size_t | indent, | ||
const bool | onlyOutput, | ||
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.
This gives us code like:
result = IO.GetParam[int]('param_name')
This gives us code like:
result['param_name'] = IO.GetParam[int]('param_name')
void mlpack::bindings::python::PrintOutputProcessing | ( | util::ParamData & | d, |
const size_t | indent, | ||
const bool | onlyOutput, | ||
const typename std::enable_if< arma::is_arma_type< T >::value >::type * | = 0 |
||
) |
Print output processing for a matrix type.
This gives us code like:
result = arma_numpy.mat_to_numpy_X(IO.GetParam[mat]("name"))
where X indicates the type to convert to.
This gives us code like:
result['param_name'] = arma_numpy.mat_to_numpy_X(IO.GetParam[mat]('name')
where X indicates the type to convert to.
void mlpack::bindings::python::PrintOutputProcessing | ( | util::ParamData & | d, |
const size_t | indent, | ||
const bool | onlyOutput, | ||
const typename std::enable_if< std::is_same< T, std::tuple< data::DatasetInfo, arma::mat >>::value >::type * | = 0 |
||
) |
Print output processing for a dataset info / matrix combination.
This gives us code like:
result = arma_numpy.mat_to_numpy_X(GetParamWithInfo[mat]('name'))
This gives us code like:
result['param_name'] = arma_numpy.mat_to_numpy_X(GetParamWithInfo[mat]('name'))
void mlpack::bindings::python::PrintOutputProcessing | ( | util::ParamData & | d, |
const size_t | indent, | ||
const bool | onlyOutput, | ||
const typename std::enable_if<!arma::is_arma_type< T >::value >::type * | = 0 , |
||
const typename std::enable_if< data::HasSerialize< T >::value >::type * | = 0 |
||
) |
Print output processing for a serializable model.
This gives us code like:
result = ModelType() (<ModelType?> result).modelptr = GetParamPtr[Model]('name')
But we also have to check to ensure there aren't any input model parameters of the same type that could have the same model pointer. So we need to loop through all input parameters that have the same type, and double-check.
This gives us code like:
result['name'] = ModelType() (<ModelType?> result['name']).modelptr = GetParamPtr[Model]('name'))
But we also have to check to ensure there aren't any input model parameters of the same type that could have the same model pointer. So we need to loop through all input parameters that have the same type, and double-check.
void mlpack::bindings::python::PrintOutputProcessing | ( | util::ParamData & | d, |
const void * | input, | ||
void * | |||
) |
Given parameter information and the current number of spaces for indentation, print the code to process the output to cout.
This code assumes that data.input is false, and should not be called when data.input is true. If this is the only output, the results will be different.
The input pointer should be a pointer to a std::tuple<size_t, bool> where the first element is the indentation and the second element is a boolean representing whether or not this is the only output parameter.
d | Parameter data struct. |
input | Pointer to size_t holding the indentation. |
* | (output) Unused parameter. |