RandomForestProgressVisitor.hxx | RandomForestProgressVisitor.hxx | |||
---|---|---|---|---|
#ifndef RANDOMFORESTPROGRESSVISITOR_HXX | #ifndef RANDOMFORESTPROGRESSVISITOR_HXX | |||
#define RANDOMFORESTPROGRESSVISITOR_HXX | #define RANDOMFORESTPROGRESSVISITOR_HXX | |||
#include <iostream> | #include <iostream> | |||
#include <iomanip> | #include <iomanip> | |||
#include <vigra/random_forest.hxx> | #include <vigra/random_forest.hxx> | |||
//#include <vigra/random_forest_hdf5_impex.hxx> | //#include <vigra/random_forest_hdf5_impex.hxx> | |||
#include <vigra/timing.hxx> | #include <vigra/timing.hxx> | |||
namespace vigra | ||||
class RandomForestProgressVisitor : public vigra::VisitorBase { | { | |||
namespace rf | ||||
{ | ||||
namespace visitors | ||||
{ | ||||
class MatlabRandomForestProgressVisitor : public VisitorBase { | ||||
public: | public: | |||
RandomForestProgressVisitor() : VisitorBase() {} | MatlabRandomForestProgressVisitor() : VisitorBase() {} | |||
template<class RF, class PR, class SM, class ST> | template<class RF, class PR, class SM, class ST> | |||
void visit_after_tree(RF& rf, PR & pr, SM & sm, ST & st, int index){ | void visit_after_tree(RF& rf, PR & pr, SM & sm, ST & st, int index){ | |||
mexPrintf("%d of %d learned\n", index, rf.options().tree_count_); | mexPrintf("%d of %d learned\n", index, rf.options().tree_count_); | |||
} | } | |||
template<class RF, class PR> | template<class RF, class PR> | |||
void visit_at_end(RF const & rf, PR const & pr) { | void visit_at_end(RF const & rf, PR const & pr) { | |||
mexPrintf("all trees learned\n"); | mexPrintf("all trees learned\n"); | |||
} | } | |||
template<class RF, class PR> | template<class RF, class PR> | |||
void visit_at_beginning(RF const & rf, PR const & pr) { | void visit_at_beginning(RF const & rf, PR const & pr) { | |||
mexPrintf("growing random forest, which will have %d trees\n", rf.o ptions().tree_count_); | mexPrintf("growing random forest, which will have %d trees\n", rf.o ptions().tree_count_); | |||
} | } | |||
}; | }; | |||
} | ||||
} | ||||
} | ||||
#endif //RANDOMFORESTPROGRESSVISITOR_HXX | #endif //RANDOMFORESTPROGRESSVISITOR_HXX | |||
End of changes. 3 change blocks. | ||||
4 lines changed or deleted | 11 lines changed or added | |||
This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/ |