资源简介
运用AdaBoost算法实现了对人脸表情的分类
代码片段和文件信息
/****************************************************************/
/* */
/* AdaBoostMH for WSD */
/* */
/* Copyright (2005) Dlut NLP Lab. All rights reserved. */
/* */
/* This program contains the confidential trade secret */
/* information of Dlut NLP Lab. Use disclosure or */
/* copying without written consent is strictly prohibited. */
/* */
/****************************************************************/
/*--------------------------------------------------------------
*
* OUTLINE:
*
* This module implements a AdaBoostMH procedure for WSD.
*
* IMPLEMENTATION:
*
* NOTES:
*
*--------------------------------------------------------------*/
#define USE_OPERATEFILE
#define USE_AdaBoostMH
#include “AdaBoostMH.h“
USEWINASSERT
/*--- Useful type defines for train class object ---*/
#define PADTRAINMATRIX double *
#define PADTRAINWEIGHT double *
#define PANSENSES int *
#define PANTRAINS int *
#define PANTESTS int *
#define PANEXAMPLES int *
#define PANFEATURES int *
#define NUMEXAMPLE int
#define EXAMPLE int
#define FEATURE int
#define DZMIN double
#define FIXVALUE double
/*--- Useful struct defines for train class object ---*/
typedef struct _trainExample {
EXAMPLE example; //example
struct _trainExample *next;
} *PTRAINEXAMPLE;
typedef struct _trainWR {
DZMIN z; //Zmin
FEATURE feature; //
PADTRAINWEIGHT weights[2]; //
struct _trainWR *next;
} *PTRAINWR;
/*--- The train class object ---*/
CLASS(hAdaBoostMH HADABOOSTMH) {
NUMLOOP numLoop; //Number of loop
NUMFEATURE numFeature; //Number of features
PANTRAINS pTrains; //Array of tarin examples
NUMTRAIN numTrain; //Number of train examples (size of pTrains)
PANTESTS pTests; //Array of test examples
NUMTEST numTest; //Number of test examples (size of pTests)
PANSENSES pSenses; //Array of senses
NUMSENSE numSense; //Number of senses ( size of panSense )
PTRAINEXAMPLE *ppFeatures; //Array of points to list of example with this feature
PADTRAINMATRIX *ppMatrix; //Matrix of weights of senses*trains
PTRAINWR pTrainWR; //Array of WeakRule
PADTRAINWEIGHT *ppAccumulated;//For test
};
/*--- The struct for test result ---*/
typedef struct result{
short int sense;
double weight;
} TestResult;
/*--- Local prototypes ---*/
void LOCAL FreeTrainWR ( HADABOOSTMH ) ;
void LOCAL GetExamples ( HADABOOSTMH LPSTR NUMEXAMPLE PANEXAMPLES ) ;
PTRAINWR LOCAL LearnWeakRule ( HADABOOSTMH NUMLOOP PADTRAINWEIGHT []
PADTRAINWEIGHT [][2] );
PTRAINWR LOCAL LearnProcess ( HADABOOSTMH NUMLOOP PANFEATURES
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 29305 2005-05-10 14:33 AdaBoostMHClass\AdaBoostMH.c
文件 2212 2005-05-10 13:52 AdaBoostMHClass\AdaBoostMH.h
文件 91 2005-05-09 08:40 AdaBoostMHClass\AdaBoostMHClass.dep
文件 4684 2005-05-10 13:44 AdaBoostMHClass\AdaBoostMHClass.dsp
文件 553 2005-05-09 08:40 AdaBoostMHClass\AdaBoostMHClass.dsw
文件 5033 2005-05-10 13:44 AdaBoostMHClass\AdaBoostMHClass.mak
文件 74752 2005-05-10 15:53 AdaBoostMHClass\AdaBoostMHClass.ncb
文件 50688 2005-05-10 15:53 AdaBoostMHClass\AdaBoostMHClass.opt
文件 1381 2005-05-10 14:37 AdaBoostMHClass\AdaBoostMHClass.plg
文件 4806 2005-05-10 14:37 AdaBoostMHClass\comm.h
文件 31967 2005-05-10 14:37 AdaBoostMHClass\Debug\AdaBoostMH.obj
文件 213053 2005-05-10 14:37 AdaBoostMHClass\Debug\AdaBoostMHClass.exe
文件 274648 2005-05-10 14:37 AdaBoostMHClass\Debug\AdaBoostMHClass.ilk
文件 217692 2005-05-10 14:37 AdaBoostMHClass\Debug\AdaBoostMHClass.pch
文件 517120 2005-05-10 14:37 AdaBoostMHClass\Debug\AdaBoostMHClass.pdb
文件 10714 2005-05-10 14:37 AdaBoostMHClass\Debug\file.obj
文件 12208 2005-05-10 14:37 AdaBoostMHClass\Debug\heap.obj
文件 1786 2005-05-10 10:35 AdaBoostMHClass\Debug\test.obj
文件 4678 2005-05-10 14:37 AdaBoostMHClass\Debug\TestUnit.obj
文件 41984 2005-05-10 14:37 AdaBoostMHClass\Debug\vc60.idb
文件 53248 2005-05-10 14:37 AdaBoostMHClass\Debug\vc60.pdb
文件 1028 2005-05-09 09:51 AdaBoostMHClass\except.C
文件 6247 2005-05-10 10:55 AdaBoostMHClass\file.c
文件 12421 2005-05-09 09:28 AdaBoostMHClass\heap.c
文件 2819 2005-05-10 14:27 AdaBoostMHClass\TestUnit.c
文件 8882 2005-05-10 14:32 AdaBoostMHClass\text\close_output.txt
文件 124792 2005-05-10 14:32 AdaBoostMHClass\text\input.txt
文件 4170 2005-05-10 14:32 AdaBoostMHClass\text\open_output.txt
文件 2318 2005-03-15 12:00 AdaBoostMHClass\text\test.txt
文件 4813 2005-03-15 11:59 AdaBoostMHClass\text\train.txt
............此处省略6个文件信息
- 上一篇:邮件发送程序客户端----VC实现
- 下一篇:实验二、GIS图形数据对象的组织一
评论
共有 条评论