OpenCV  2.4.13
Open Source Computer Vision
CvANN_MLP Class Reference

#include <ml.hpp>

Inheritance diagram for CvANN_MLP:
CvStatModel

Public Types

enum  { IDENTITY = 0, SIGMOID_SYM = 1, GAUSSIAN = 2 }
 
enum  { UPDATE_WEIGHTS = 1, NO_INPUT_SCALE = 2, NO_OUTPUT_SCALE = 4 }
 

Public Member Functions

 CvANN_MLP ()
 
 CvANN_MLP (const CvMat *layerSizes, int activateFunc=CvANN_MLP::SIGMOID_SYM, double fparam1=0, double fparam2=0)
 
virtual ~CvANN_MLP ()
 
virtual void create (const CvMat *layerSizes, int activateFunc=CvANN_MLP::SIGMOID_SYM, double fparam1=0, double fparam2=0)
 
virtual int train (const CvMat *inputs, const CvMat *outputs, const CvMat *sampleWeights, const CvMat *sampleIdx=0, CvANN_MLP_TrainParams params=CvANN_MLP_TrainParams(), int flags=0)
 
virtual float predict (const CvMat *inputs, CV_OUT CvMat *outputs) const
 
 CvANN_MLP (const cv::Mat &layerSizes, int activateFunc=CvANN_MLP::SIGMOID_SYM, double fparam1=0, double fparam2=0)
 
virtual void create (const cv::Mat &layerSizes, int activateFunc=CvANN_MLP::SIGMOID_SYM, double fparam1=0, double fparam2=0)
 
virtual int train (const cv::Mat &inputs, const cv::Mat &outputs, const cv::Mat &sampleWeights, const cv::Mat &sampleIdx=cv::Mat(), CvANN_MLP_TrainParams params=CvANN_MLP_TrainParams(), int flags=0)
 
virtual float predict (const cv::Mat &inputs, CV_OUT cv::Mat &outputs) const
 
virtual void clear ()
 
virtual void read (CvFileStorage *fs, CvFileNode *node)
 
virtual void write (CvFileStorage *storage, const char *name) const
 
int get_layer_count ()
 
const CvMatget_layer_sizes ()
 
double * get_weights (int layer)
 
virtual void calc_activ_func_deriv (CvMat *xf, CvMat *deriv, const double *bias) const
 
- Public Member Functions inherited from CvStatModel
 CvStatModel ()
 
virtual ~CvStatModel ()
 
virtual void save (const char *filename, const char *name=0) const
 
virtual void load (const char *filename, const char *name=0)
 

Protected Member Functions

virtual bool prepare_to_train (const CvMat *_inputs, const CvMat *_outputs, const CvMat *_sample_weights, const CvMat *sampleIdx, CvVectors *_ivecs, CvVectors *_ovecs, double **_sw, int _flags)
 
virtual int train_backprop (CvVectors _ivecs, CvVectors _ovecs, const double *_sw)
 
virtual int train_rprop (CvVectors _ivecs, CvVectors _ovecs, const double *_sw)
 
virtual void calc_activ_func (CvMat *xf, const double *bias) const
 
virtual void set_activ_func (int _activ_func=SIGMOID_SYM, double _f_param1=0, double _f_param2=0)
 
virtual void init_weights ()
 
virtual void scale_input (const CvMat *_src, CvMat *_dst) const
 
virtual void scale_output (const CvMat *_src, CvMat *_dst) const
 
virtual void calc_input_scale (const CvVectors *vecs, int flags)
 
virtual void calc_output_scale (const CvVectors *vecs, int flags)
 
virtual void write_params (CvFileStorage *fs) const
 
virtual void read_params (CvFileStorage *fs, CvFileNode *node)
 

Protected Attributes

CvMatlayer_sizes
 
CvMatwbuf
 
CvMatsample_weights
 
double ** weights
 
double f_param1
 
double f_param2
 
double min_val
 
double max_val
 
double min_val1
 
double max_val1
 
int activ_func
 
int max_count
 
int max_buf_sz
 
CvANN_MLP_TrainParams params
 
cv::RNGrng
 
- Protected Attributes inherited from CvStatModel
const char * default_model_name
 

Member Enumeration Documentation

anonymous enum
Enumerator
IDENTITY 
SIGMOID_SYM 
GAUSSIAN 
anonymous enum
Enumerator
UPDATE_WEIGHTS 
NO_INPUT_SCALE 
NO_OUTPUT_SCALE 

Constructor & Destructor Documentation

CvANN_MLP::CvANN_MLP ( )
CvANN_MLP::CvANN_MLP ( const CvMat layerSizes,
int  activateFunc = CvANN_MLP::SIGMOID_SYM,
double  fparam1 = 0,
double  fparam2 = 0 
)
virtual CvANN_MLP::~CvANN_MLP ( )
virtual
CvANN_MLP::CvANN_MLP ( const cv::Mat layerSizes,
int  activateFunc = CvANN_MLP::SIGMOID_SYM,
double  fparam1 = 0,
double  fparam2 = 0 
)

Member Function Documentation

virtual void CvANN_MLP::calc_activ_func ( CvMat xf,
const double *  bias 
) const
protectedvirtual
virtual void CvANN_MLP::calc_activ_func_deriv ( CvMat xf,
CvMat deriv,
const double *  bias 
) const
virtual
virtual void CvANN_MLP::calc_input_scale ( const CvVectors vecs,
int  flags 
)
protectedvirtual
virtual void CvANN_MLP::calc_output_scale ( const CvVectors vecs,
int  flags 
)
protectedvirtual
virtual void CvANN_MLP::clear ( )
virtual

Reimplemented from CvStatModel.

virtual void CvANN_MLP::create ( const CvMat layerSizes,
int  activateFunc = CvANN_MLP::SIGMOID_SYM,
double  fparam1 = 0,
double  fparam2 = 0 
)
virtual
virtual void CvANN_MLP::create ( const cv::Mat layerSizes,
int  activateFunc = CvANN_MLP::SIGMOID_SYM,
double  fparam1 = 0,
double  fparam2 = 0 
)
virtual
int CvANN_MLP::get_layer_count ( )
inline
const CvMat* CvANN_MLP::get_layer_sizes ( )
inline
double* CvANN_MLP::get_weights ( int  layer)
inline
virtual void CvANN_MLP::init_weights ( )
protectedvirtual
virtual float CvANN_MLP::predict ( const CvMat inputs,
CV_OUT CvMat outputs 
) const
virtual
virtual float CvANN_MLP::predict ( const cv::Mat inputs,
CV_OUT cv::Mat outputs 
) const
virtual
virtual bool CvANN_MLP::prepare_to_train ( const CvMat _inputs,
const CvMat _outputs,
const CvMat _sample_weights,
const CvMat sampleIdx,
CvVectors _ivecs,
CvVectors _ovecs,
double **  _sw,
int  _flags 
)
protectedvirtual
virtual void CvANN_MLP::read ( CvFileStorage fs,
CvFileNode node 
)
virtual

Reimplemented from CvStatModel.

virtual void CvANN_MLP::read_params ( CvFileStorage fs,
CvFileNode node 
)
protectedvirtual
virtual void CvANN_MLP::scale_input ( const CvMat _src,
CvMat _dst 
) const
protectedvirtual
virtual void CvANN_MLP::scale_output ( const CvMat _src,
CvMat _dst 
) const
protectedvirtual
virtual void CvANN_MLP::set_activ_func ( int  _activ_func = SIGMOID_SYM,
double  _f_param1 = 0,
double  _f_param2 = 0 
)
protectedvirtual
virtual int CvANN_MLP::train ( const CvMat inputs,
const CvMat outputs,
const CvMat sampleWeights,
const CvMat sampleIdx = 0,
CvANN_MLP_TrainParams  params = CvANN_MLP_TrainParams(),
int  flags = 0 
)
virtual
virtual int CvANN_MLP::train ( const cv::Mat inputs,
const cv::Mat outputs,
const cv::Mat sampleWeights,
const cv::Mat sampleIdx = cv::Mat(),
CvANN_MLP_TrainParams  params = CvANN_MLP_TrainParams(),
int  flags = 0 
)
virtual
virtual int CvANN_MLP::train_backprop ( CvVectors  _ivecs,
CvVectors  _ovecs,
const double *  _sw 
)
protectedvirtual
virtual int CvANN_MLP::train_rprop ( CvVectors  _ivecs,
CvVectors  _ovecs,
const double *  _sw 
)
protectedvirtual
virtual void CvANN_MLP::write ( CvFileStorage storage,
const char *  name 
) const
virtual

Reimplemented from CvStatModel.

virtual void CvANN_MLP::write_params ( CvFileStorage fs) const
protectedvirtual

Member Data Documentation

int CvANN_MLP::activ_func
protected
double CvANN_MLP::f_param1
protected
double CvANN_MLP::f_param2
protected
CvMat* CvANN_MLP::layer_sizes
protected
int CvANN_MLP::max_buf_sz
protected
int CvANN_MLP::max_count
protected
double CvANN_MLP::max_val
protected
double CvANN_MLP::max_val1
protected
double CvANN_MLP::min_val
protected
double CvANN_MLP::min_val1
protected
CvANN_MLP_TrainParams CvANN_MLP::params
protected
cv::RNG* CvANN_MLP::rng
protected
CvMat* CvANN_MLP::sample_weights
protected
CvMat* CvANN_MLP::wbuf
protected
double** CvANN_MLP::weights
protected

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