Skylark (Sketching Library)  0.1
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions
skylark::ml::model_t< InputType, OutputType > Struct Template Reference

#include <model.hpp>

List of all members.

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_typeget_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)

Detailed Description

template<typename InputType, typename OutputType>
struct skylark::ml::model_t< InputType, OutputType >

Definition at line 50 of file model.hpp.


Member Typedef Documentation

template<typename InputType, typename OutputType>
typedef elem::Matrix<double> skylark::ml::model_t< InputType, OutputType >::coef_type

Definition at line 59 of file model.hpp.

template<typename InputType, typename OutputType>
typedef skylark::sketch::sketch_transform_t<input_type, intermediate_type> skylark::ml::model_t< InputType, OutputType >::feature_transform_type

Definition at line 62 of file model.hpp.

template<typename InputType, typename OutputType>
typedef InputType skylark::ml::model_t< InputType, OutputType >::input_type

Definition at line 53 of file model.hpp.

template<typename InputType, typename OutputType>
typedef elem::Matrix<double> skylark::ml::model_t< InputType, OutputType >::intermediate_type

Definition at line 58 of file model.hpp.

template<typename InputType, typename OutputType>
typedef OutputType skylark::ml::model_t< InputType, OutputType >::output_type

Definition at line 54 of file model.hpp.


Constructor & Destructor Documentation

template<typename InputType, typename OutputType>
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]

Definition at line 64 of file model.hpp.

template<typename InputType, typename OutputType>
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().

Here is the call graph for this function:

template<typename InputType, typename OutputType>
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().

Here is the call graph for this function:


Member Function Documentation

template<typename InputType, typename OutputType>
void skylark::ml::model_t< InputType, OutputType >::build_from_ptree ( const boost::property_tree::ptree &  pt) [inline, protected]
template<typename InputType , typename OutputType >
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().

Here is the call graph for this function:

template<typename InputType, typename OutputType>
coef_type& skylark::ml::model_t< InputType, OutputType >::get_coef ( ) [inline]

Definition at line 207 of file model.hpp.

Referenced by BlockADMMSolver< T >::train().

template<typename InputType, typename OutputType>
int skylark::ml::model_t< InputType, OutputType >::get_input_size ( ) const [inline]

Definition at line 212 of file model.hpp.

Referenced by run().

template<typename InputType, typename OutputType>
int skylark::ml::model_t< InputType, OutputType >::get_num_outputs ( ) const [inline]

Definition at line 211 of file model.hpp.

Referenced by run().

template<typename InputType, typename OutputType>
void skylark::ml::model_t< InputType, OutputType >::get_probabilities ( input_type X,
output_type P,
int  num_threads = 1 
) const
template<typename InputType, typename OutputType>
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().

Here is the call graph for this function:

template<typename InputType, typename OutputType>
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().

Here is the call graph for this function:

template<typename InputType, typename OutputType>
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().


The documentation for this struct was generated from the following file: