OnlineLearnable.h 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. #ifndef _NICE_ONLINELEARNABLEINCLUDE
  2. #define _NICE_ONLINELEARNABLEINCLUDE
  3. // NICE-core includes
  4. #include <core/vector/SparseVectorT.h>
  5. #include <core/vector/VectorT.h>
  6. namespace NICE {
  7. /**
  8. * @class OnlineLearnable
  9. * @brief Interface specifying learning algorithms implementing methods for online updates
  10. * @author Alexander Freytag
  11. * @date 01-01-2014 (dd-mm-yyyy)
  12. */
  13. class OnlineLearnable {
  14. public:
  15. // Interface specifications
  16. virtual void addExample( const NICE::SparseVector * example,
  17. const double & label,
  18. const bool & performOptimizationAfterIncrement = true
  19. ) = 0;
  20. virtual void addMultipleExamples( const std::vector< const NICE::SparseVector * > & newExamples,
  21. const NICE::Vector & newLabels,
  22. const bool & performOptimizationAfterIncrement = true
  23. ) = 0;
  24. // Provided functions and overloaded stream operators
  25. virtual ~OnlineLearnable () {};
  26. // just to prevent senseless compiler warnings
  27. OnlineLearnable() {};
  28. };
  29. } // namespace
  30. #endif