Skylark (Sketching Library)
0.1
|
#include <model.hpp>
Public Types | |
typedef InputType | input_type |
typedef OutputType | output_type |
typedef elem::Matrix< double > | intermediate_type |
typedef elem::Matrix< double > | coef_type |
typedef skylark::sketch::sketch_transform_t < input_type, intermediate_type > | feature_transform_type |
Public Member Functions | |
model_t (std::vector< const feature_transform_type * > &maps, bool scale_maps, int num_features, int num_outputs) | |
model_t (const boost::property_tree::ptree &pt) | |
model_t (const std::string &fname) | |
boost::property_tree::ptree | to_ptree () const |
void | save (const std::string &fname, const std::string &header) const |
void | predict (input_type &X, output_type &PV, output_type &DV, int num_threads=1) const |
void | get_probabilities (input_type &X, output_type &P, int num_threads=1) const |
coef_type & | get_coef () |
int | get_num_outputs () const |
int | get_input_size () const |
Static Public Member Functions | |
static double | evaluate (output_type &Yt, output_type &Yp, const boost::mpi::communicator &comm) |
Protected Member Functions | |
void | build_from_ptree (const boost::property_tree::ptree &pt) |
typedef elem::Matrix<double> skylark::ml::model_t< InputType, OutputType >::coef_type |
typedef skylark::sketch::sketch_transform_t<input_type, intermediate_type> skylark::ml::model_t< InputType, OutputType >::feature_transform_type |
typedef InputType skylark::ml::model_t< InputType, OutputType >::input_type |
typedef elem::Matrix<double> skylark::ml::model_t< InputType, OutputType >::intermediate_type |
typedef OutputType skylark::ml::model_t< InputType, OutputType >::output_type |
skylark::ml::model_t< InputType, OutputType >::model_t | ( | std::vector< const feature_transform_type * > & | maps, |
bool | scale_maps, | ||
int | num_features, | ||
int | num_outputs | ||
) | [inline] |
skylark::ml::model_t< InputType, OutputType >::model_t | ( | const boost::property_tree::ptree & | pt | ) | [inline] |
Definition at line 84 of file model.hpp.
References skylark::ml::model_t< InputType, OutputType >::build_from_ptree().
skylark::ml::model_t< InputType, OutputType >::model_t | ( | const std::string & | fname | ) | [inline] |
Definition at line 88 of file model.hpp.
References skylark::ml::model_t< InputType, OutputType >::build_from_ptree(), and max().
void skylark::ml::model_t< InputType, OutputType >::build_from_ptree | ( | const boost::property_tree::ptree & | pt | ) | [inline, protected] |
Definition at line 216 of file model.hpp.
References skylark::sketch::sketch_transform_t< InputMatrixType, OutputMatrixType >::from_ptree().
Referenced by skylark::ml::model_t< InputType, OutputType >::model_t().
double skylark::ml::model_t< InputType, OutputType >::evaluate | ( | output_type & | Yt, |
output_type & | Yp, | ||
const boost::mpi::communicator & | comm | ||
) | [static] |
Definition at line 268 of file model.hpp.
References skylark::ml::classification_accuracy().
Referenced by run(), and BlockADMMSolver< T >::train().
coef_type& skylark::ml::model_t< InputType, OutputType >::get_coef | ( | ) | [inline] |
Definition at line 207 of file model.hpp.
Referenced by BlockADMMSolver< T >::train().
int skylark::ml::model_t< InputType, OutputType >::get_input_size | ( | ) | const [inline] |
int skylark::ml::model_t< InputType, OutputType >::get_num_outputs | ( | ) | const [inline] |
void skylark::ml::model_t< InputType, OutputType >::get_probabilities | ( | input_type & | X, |
output_type & | P, | ||
int | num_threads = 1 |
||
) | const |
void skylark::ml::model_t< InputType, OutputType >::predict | ( | input_type & | X, |
output_type & | PV, | ||
output_type & | DV, | ||
int | num_threads = 1 |
||
) | const [inline] |
Definition at line 141 of file model.hpp.
References skylark::base::Gemm(), skylark::base::Height(), n, and skylark::base::Width().
Referenced by run(), and BlockADMMSolver< T >::train().
void skylark::ml::model_t< InputType, OutputType >::save | ( | const std::string & | fname, |
const std::string & | header | ||
) | const [inline] |
Saves the model to a file named fname. You may want to use this method from only a single rank.
Definition at line 133 of file model.hpp.
References skylark::ml::model_t< InputType, OutputType >::to_ptree().
Referenced by run().
boost::property_tree::ptree skylark::ml::model_t< InputType, OutputType >::to_ptree | ( | ) | const [inline] |
Definition at line 101 of file model.hpp.
References VERSION.
Referenced by skylark::ml::model_t< InputType, OutputType >::save().