資源簡介
通過gabor小波提取表情特征,pca進行降維,最后通elm進行分類,識別結果由MATLAB的GUI輸出
代碼片段和文件信息
function?[TestingTime?label_index_expected?output]?=?elm_predict(test_data?dt)
%?Usage:?elm_predict(TestingData_File)
%?OR:????[TestingTime?TestingAccuracy]?=?elm_predict(TestingData_File)
%
%?Input:
%?TestingData_File??????-?Filename?of?testing?data?set
%
%?Output:
%?TestingTime???????????-?Time?(seconds)?spent?on?predicting?ALL?testing?data
%?TestingAccuracy???????-?Testing?accuracy:
%???????????????????????????RMSE?for?regression?or?correct?classification?rate?for?classification
%
%?MULTI-CLASSE?CLASSIFICATION:?NUMBER?OF?OUTPUT?NEURONS?WILL?BE?AUTOMATICALLY?SET?EQUAL?TO?NUMBER?OF?CLASSES
%?FOR?EXAMPLE?if?there?are?7?classes?in?all?there?will?have?7?output
%?neurons;?neuron?5?has?the?highest?output?means?input?belongs?to?5-th?class
%
%?Sample1?regression:?[TestingTime?TestingAccuracy]?=?elm_predict(‘sinc_test‘)
%?Sample2?classification:?elm_predict(‘diabetes_test‘)
%
%%%%????Authors:????MR?QIN-YU?ZHU?AND?DR?GUANG-BIN?HUANG
%%%%????NANYANG?TECHNOLOGICAL?UNIVERSITY?SINGAPORE
%%%%????EMAIL:??????EGBHUANG@NTU.EDU.SG;?GBHUANG@IEEE.ORG
%%%%????WEBSITE:????http://www.ntu.edu.sg/eee/icis/cv/egbhuang.htm
%%%%????DATE:???????APRIL?2004
%%%%%%%%%%%?Macro?definition
REGRESSION=0;
CLASSIFIER=1;
label_index_expected?=?0;
%%%%%%%%%%%?Load?testing?dataset
TV.T=test_data(:1)‘;
TV.P=test_data(:2:size(test_data2))‘;
clear?test_data;????????????????????????????????????%???Release?raw?testing?data?array
NumberofTestingData=size(TV.P2);
load?elm_model.mat;
if?Elm_Type~=REGRESSION
????
????%%%%%%%%%%?Processing?the?targets?of?testing
????temp_TV_T=zeros(NumberofOutputNeurons?NumberofTestingData);
????for?i?=?1:NumberofTestingData
????????for?j?=?1:size(label2)
????????????if?label(1j)?==?TV.T(1i)
????????????????break;
????????????end
????????end
????????temp_TV_T(ji)=1;
????end
????TV.T=temp_TV_T*2-1;
????
end?????????????????????????????????????????????????%???end?if?of?Elm_Type
%%%%%%%%%%%?Calculate?the?output?of?testing?input
start_time_test=cputime;
tempH_test=InputWeight*TV.P;
clear?TV.P;?????????????%???Release?input?of?testing?data
ind=ones(1NumberofTestingData);
BiasMatrix=BiasofHiddenNeurons(:ind);??????????????%???Extend?the?bias?matrix?BiasofHiddenNeurons?to?match?the?demention?of?H
tempH_test=tempH_test?+?BiasMatrix;
switch?lower(ActivationFunction)
????case?{‘sig‘‘sigmoid‘}
????????%%%%%%%%?Sigmoid
????????H_test?=?1?./?(1?+?exp(-tempH_test));
????case?{‘sin‘‘sine‘}
????????%%%%%%%%?Sine
????????H_test?=?sin(tempH_test);
????case?{‘hardlim‘}
????????%%%%%%%%?Hard?Limit
????????H_test?=?hardlim(tempH_test);
????????%%%%%%%%?More?activation?functions?can?be?added?here
end
TY=(H_test‘?*?OutputWeight)‘;???????????????????????%???TY:?the?actual?output?of?the?testing?data
end_time_test=cputime;
TestingTime=end_time_test-start_time_test;???????????%???Calculate?CPU?time?(seconds)?spent?by?ELM?predicting?the?whole?testing?data
if?Elm_Type?==?REGRESSION
???
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2018-03-05?20:01??微表情識別代碼\
?????目錄???????????0??2018-03-05?20:01??微表情識別代碼\Databa
?????文件???????65734??2001-02-13?13:40??微表情識別代碼\Databa
?????文件???????67368??2004-07-20?18:55??微表情識別代碼\Databa
?????文件???????65734??2001-02-13?13:40??微表情識別代碼\Databa
?????文件???????65734??2001-02-13?13:40??微表情識別代碼\Databa
?????文件???????65734??2001-02-13?13:40??微表情識別代碼\Databa
?????文件???????65734??2001-02-13?13:40??微表情識別代碼\Databa
?????文件???????65734??2001-02-13?13:40??微表情識別代碼\Databa
?????文件???????65734??2001-02-13?13:40??微表情識別代碼\Databa
?????文件???????65734??2001-02-13?13:40??微表情識別代碼\Databa
?????文件???????65734??2001-02-13?13:40??微表情識別代碼\Databa
?????文件???????65734??2001-02-13?13:41??微表情識別代碼\Databa
?????文件???????65734??2001-02-13?13:41??微表情識別代碼\Databa
?????文件???????65734??2001-02-13?13:41??微表情識別代碼\Databa
?????文件???????65734??2001-02-13?13:41??微表情識別代碼\Databa
?????文件???????65734??2001-02-13?13:41??微表情識別代碼\Databa
?????文件???????65734??2001-02-13?13:41??微表情識別代碼\Databa
?????文件???????65734??2001-02-13?13:41??微表情識別代碼\Databa
?????文件???????65734??2001-02-13?13:41??微表情識別代碼\Databa
?????文件???????65734??2001-02-13?13:41??微表情識別代碼\Databa
?????文件???????65734??2001-02-13?13:41??微表情識別代碼\Databa
?????文件???????65734??2001-02-13?13:41??微表情識別代碼\Databa
?????文件???????65734??2001-02-13?13:42??微表情識別代碼\Databa
?????文件???????65734??2001-02-13?13:42??微表情識別代碼\Databa
?????文件???????65734??2001-02-13?13:42??微表情識別代碼\Databa
?????文件???????65734??2001-02-13?13:43??微表情識別代碼\Databa
?????文件???????65734??2001-02-13?13:43??微表情識別代碼\Databa
?????文件???????65734??2001-02-13?13:43??微表情識別代碼\Databa
?????文件???????65734??2001-02-13?13:43??微表情識別代碼\Databa
?????文件???????65734??2001-02-13?13:43??微表情識別代碼\Databa
............此處省略661個文件信息
評論
共有 條評論