nickgillian / grt

gesture recognition toolkit
861 stars 284 forks source link

Only the last stage of `featureDataReady` is effective #75

Closed nebgnahz closed 8 years ago

nebgnahz commented 8 years ago

Only the last stage of featureDataReady is being considered when training pipeline for TimeSeriesClassificationData. In the loop:

for(UINT moduleIndex=0; moduleIndex<featureExtractionModules.size(); moduleIndex++)

the pipeline iterates through all feature extraction modules and featureDataReady is overwritten every time. This would be a problem in scenarios like the following:

    GRT::FFT fft(512, 128, 1, GRT::FFT::HAMMING_WINDOW, true, false);
    GRT::FFTFeatures fft_feature(256);

    pipeline.addFeatureExtractionModule(fft);
    pipeline.addFeatureExtractionModule(fft_feature);
    pipeline.setClassifier(SVM(SVM::LINEAR_KERNEL, SVM::C_SVC, true, true));

Although FFT result isn't ready in the first 512 samples, the FFTFeatures is computed anyway and the flag is then turned true.

nickgillian commented 8 years ago

Was this issue fixed in the merge?

nebgnahz commented 8 years ago

Yes, you merged it (https://github.com/nickgillian/grt/commit/e9b1148556f78576c0de176aeca88f599e507ee8) and from my experiment, this seems to work.