|
CEBL
2.1
|
#include <RealTimeClassification.hpp>
Public Member Functions | |
| RealTimeClassification (CEBLModel *) | |
| ~RealTimeClassification () | |
| bool | isReady () const |
| bool | isClassifying () const |
| check whether data is currently being classified | |
| bool | lastTrainFailed () const |
| std::vector< int > | readClassificationQueue () |
| reads queue of classified sequences and clears the queue | |
| std::vector< int > | peekClassificationQueue () const |
| reads queue of classified sequences without clearing the queue | |
| std::vector< double > | getClassProportions () |
| int | getSelectedClass () const |
| void | clearSelectedClass () |
| void | clearClassificationQueue () |
| void | trainClassifier () |
| void | trainClassifierThreaded () |
| bool | isTrainingClassifier () |
| void | trainClassifierHalt () |
| void | startClassifying () |
| void | stopClassifying () |
| void | timeoutFunction () |
Public Member Functions inherited from TimeoutThread | |
| TimeoutThread () | |
| virtual | ~TimeoutThread () |
| bool | isHalted () |
| bool | isStarted () |
| double | getTimeoutLength () |
| get length of timeout in milliseconds | |
| void | setTimeoutLength (double l) |
| set length of timeotu in milliseconds | |
Friends | |
| void | runTrainClassifier (RealTimeClassification *) |
| friend function to run trainClassifier | |
Additional Inherited Members | |
Protected Member Functions inherited from TimeoutThread | |
| void | timeoutStart () |
| start the thread | |
| void | haltAndJoin () |
| halt the thread and wait for it to finish | |
| void | sleep (double stime) |
| sleep for stime in milliseconds | |
Protected Attributes inherited from TimeoutThread | |
| boost::thread * | updater_thread |
| the thread object | |
| bool | is_started |
| flag to indicate whether or not the thread is started | |
| bool | halt |
| flag to order thread to halt on next iteration | |
| bool | halted |
| flag to indicate whether or not thread has hlated | |
| boost::mutex | thread_lock |
| mutex to lock the thread | |
| double | timeout_length |
| how often updater is called | |
Definition at line 36 of file RealTimeClassification.hpp.
| RealTimeClassification::RealTimeClassification | ( | CEBLModel * | model | ) |
Controls real-time classifying.
Definition at line 17 of file RealTimeClassification.cpp.
References TimeoutThread::timeout_length.
| RealTimeClassification::~RealTimeClassification | ( | ) |
Definition at line 28 of file RealTimeClassification.cpp.
| void RealTimeClassification::clearClassificationQueue | ( | ) |
Definition at line 60 of file RealTimeClassification.cpp.
References TimeoutThread::thread_lock.
Referenced by readClassificationQueue(), CEBLModel::realtimeClearClassificationQueue(), and stopClassifying().
|
inline |
Definition at line 67 of file RealTimeClassification.hpp.
Referenced by CEBLModel::realtimeClearSelectedClass().
|
inline |
Definition at line 65 of file RealTimeClassification.hpp.
Referenced by CEBLModel::realtimeGetClassProportions().
|
inline |
Definition at line 66 of file RealTimeClassification.hpp.
Referenced by CEBLModel::realtimeGetSelectedClass().
| bool RealTimeClassification::isClassifying | ( | ) | const |
check whether data is currently being classified
Definition at line 39 of file RealTimeClassification.cpp.
Referenced by CEBLModel::realtimeIsClassifying().
| bool RealTimeClassification::isReady | ( | ) | const |
Definition at line 34 of file RealTimeClassification.cpp.
References CEBLModel::classifierIsTrained().
Referenced by CEBLModel::realtimeIsReady(), and startClassifying().
| bool RealTimeClassification::isTrainingClassifier | ( | ) |
Definition at line 260 of file RealTimeClassification.cpp.
Referenced by CEBLModel::realtimeIsTrainingClassifier().
|
inline |
Definition at line 62 of file RealTimeClassification.hpp.
Referenced by CEBLModel::realtimeLastTrainFailed().
| std::vector< int > RealTimeClassification::peekClassificationQueue | ( | ) | const |
reads queue of classified sequences without clearing the queue
Definition at line 52 of file RealTimeClassification.cpp.
Referenced by CEBLModel::realtimePeekClassificationQueue().
| std::vector< int > RealTimeClassification::readClassificationQueue | ( | ) |
reads queue of classified sequences and clears the queue
Definition at line 44 of file RealTimeClassification.cpp.
References clearClassificationQueue().
Referenced by CEBLModel::realtimeReadClassificationQueue().
| void RealTimeClassification::startClassifying | ( | ) |
Definition at line 139 of file RealTimeClassification.cpp.
References CEBLModel::dataStart(), CEBLModel::decisionInit(), isReady(), TimeoutThread::timeoutStart(), and CEBLModel::trainingGetNumClasses().
Referenced by CEBLModel::realtimeStartClassifying().
| void RealTimeClassification::stopClassifying | ( | ) |
Definition at line 162 of file RealTimeClassification.cpp.
References clearClassificationQueue(), CEBLModel::dataStop(), and TimeoutThread::haltAndJoin().
Referenced by CEBLModel::realtimeStopClassifying().
|
virtual |
Implements TimeoutThread.
Definition at line 170 of file RealTimeClassification.cpp.
References cppR::asUblasVector(), CEBLModel::classifierUse(), CEBLModel::dataReadAll(), CEBLModel::featuresExtract(), TimeoutThread::halt, cppR::max(), EEGData::size1(), TimeoutThread::thread_lock, and cppR::whichMax().
| void RealTimeClassification::trainClassifier | ( | ) |
Definition at line 71 of file RealTimeClassification.cpp.
References CEBLModel::classifierTrain(), CEBLModel::featureReset(), CEBLModel::featuresExtract(), EEGTrainingData::get(), EEGTrainingData::numClasses(), EEGTrainingData::numSequences(), CEBLModel::processData(), EEGTrainingData::reserve(), EEGTrainingData::set(), and CEBLModel::trainingGetData().
Referenced by CEBLModel::realtimeTrainClassifier(), and runTrainClassifier().
| void RealTimeClassification::trainClassifierHalt | ( | ) |
Definition at line 287 of file RealTimeClassification.cpp.
References CEBLModel::classifierHaltTrain(), and CEBLModel::featuresHalt().
Referenced by CEBLModel::realtimeTrainClassifierHalt().
| void RealTimeClassification::trainClassifierThreaded | ( | ) |
Definition at line 282 of file RealTimeClassification.cpp.
References cppR::bind(), and runTrainClassifier.
Referenced by CEBLModel::realtimeTrainClassifierThreaded().
|
friend |
friend function to run trainClassifier
Definition at line 265 of file RealTimeClassification.cpp.
Referenced by trainClassifierThreaded().
1.8.1.1