#include <CombinatorialOptimizer.h>
Public Member Functions | |
CombinatorialOptimizer (std::vector< boost::shared_ptr< SceneObjectLearner >> pLearners, std::vector< std::string > pObjectTypes, std::vector< boost::shared_ptr< ISM::ObjectSet >> pExamplesList) | |
boost::shared_ptr< SceneModel::Topology > | runOptimization () |
~CombinatorialOptimizer () | |
Private Member Functions | |
void | initCostFunction (const std::string &pType) |
void | initFullyMeshedTopologyAndFilterLoadedTestSets () |
void | initNeighbourhoodFunction (const std::string &pType) |
void | initOptimizationAlgorithm (const std::string &pType) |
void | initStartingTopologies (unsigned int pNumberOfStartingTopologies, const std::string &pStartingTopologiesType) |
void | initStarTopologies () |
void | initTestSets (const std::vector< std::string > &pObjectTypes, const std::vector< boost::shared_ptr< ISM::ObjectSet >> &pExamplesList) |
void | optimize (boost::shared_ptr< SceneModel::Topology > pStartingTopology, unsigned int pStartingTopologyNumber) |
Uses combinatorial optimization to train a relation graph that is optimal considering false negatives and average recognition runtime on random test sets.
Definition at line 48 of file CombinatorialOptimizer.h.
ProbabilisticSceneRecognition::CombinatorialOptimizer::CombinatorialOptimizer | ( | std::vector< boost::shared_ptr< SceneObjectLearner >> | pLearners, |
std::vector< std::string > | pObjectTypes, | ||
std::vector< boost::shared_ptr< ISM::ObjectSet >> | pExamplesList | ||
) |
Constructor.
pLearners | The learners to be used to learn OCM models for the relation graphs considered. |
pObjectTypes | All possible object types appearing in the relation graphs (once each) |
pExamplesList | The list of evidences to train on. |
Definition at line 23 of file CombinatorialOptimizer.cpp.
ProbabilisticSceneRecognition::CombinatorialOptimizer::~CombinatorialOptimizer | ( | ) |
Destructor.
Definition at line 160 of file CombinatorialOptimizer.cpp.
|
private |
Initialize the cost function used to judge topologies.
pType | type of the cost function to be used: only "WeightedSum". |
Definition at line 371 of file CombinatorialOptimizer.cpp.
|
private |
Initialize the fully meshed topology used to divide the test sets into valid and invalid ones and find the worst recognition runtime. Also deals with loaded test sets, if those were not created by the program.
Definition at line 250 of file CombinatorialOptimizer.cpp.
|
private |
Initialize neighbourhood function used to generate neighbours of currently selected topology during optimizations.
pType | type of the neighbourhood function to be used: only "TopologyManager". |
Definition at line 400 of file CombinatorialOptimizer.cpp.
|
private |
Initialize optimization algorithm to be used.
pType | type of the optimization algorithm to be used: from "HillClimbing", "RecordHunt", "SimulatedAnnealing". |
Definition at line 410 of file CombinatorialOptimizer.cpp.
|
private |
Initialize starting topologies to perform optimization from.
pNumberOfStartingTopologies | number of starting topologies to initialize. |
pStartingTopologiesType | type of algorithm to use to generate starting topologies. |
Definition at line 337 of file CombinatorialOptimizer.cpp.
|
private |
Initialize the star topologies used to find the worst false positive numbers and fastest average runtimes.
Definition at line 300 of file CombinatorialOptimizer.cpp.
|
private |
Initialize a test set generator and set evaluator test sets.
pObjectTypes | All possible object types appearing in the relation graphs (once each) |
pExamplesList | The list of evidences to train on. |
Definition at line 208 of file CombinatorialOptimizer.cpp.
|
private |
optimize from the given topology. Sets new mBestOptimizedTopology if a better one has been found.
pStartingTopology | to optimize from. |
pStartingTopologyNumber | the number of the starting topology, for output. |
Definition at line 475 of file CombinatorialOptimizer.cpp.
boost::shared_ptr< SceneModel::Topology > ProbabilisticSceneRecognition::CombinatorialOptimizer::runOptimization | ( | ) |
Perform optimization.
Definition at line 163 of file CombinatorialOptimizer.cpp.
|
private |
The best topology considered so far.
Definition at line 205 of file CombinatorialOptimizer.h.
|
private |
The cost function used to judge topologies.
Definition at line 153 of file CombinatorialOptimizer.h.
|
private |
Evaluator used to check the learned models of the topologies against the test sets.
Definition at line 148 of file CombinatorialOptimizer.h.
|
private |
fully meshed topology for all given object types.
Definition at line 138 of file CombinatorialOptimizer.h.
|
private |
How many test sets loaded from the database to use at first. Reduced to test_set_count later, but since some loaded sets may be misclassified and removed, it can be useful to load more than test_set_count.
Definition at line 237 of file CombinatorialOptimizer.h.
|
private |
Maximum average recognition runtime. All topologies with average runtimes above can be replaced by the fully meshed one, which has no false positives.
Definition at line 196 of file CombinatorialOptimizer.h.
|
private |
Maximum number of false negatives. All topologies with more can be replaced with a star topology, which will be faster.
Definition at line 191 of file CombinatorialOptimizer.h.
|
private |
Maximum number of false positives. All topologies with more can be replaced with a star topology, which will be faster.
Definition at line 186 of file CombinatorialOptimizer.h.
|
private |
Definition at line 200 of file CombinatorialOptimizer.h.
|
private |
Definition at line 200 of file CombinatorialOptimizer.h.
|
private |
Definition at line 200 of file CombinatorialOptimizer.h.
|
private |
Minimum average recognition runtime.
Definition at line 181 of file CombinatorialOptimizer.h.
|
private |
Minimum number of false negatives. Set to 0.
Definition at line 177 of file CombinatorialOptimizer.h.
|
private |
Minimum number of false positives. Set to 0.
Definition at line 173 of file CombinatorialOptimizer.h.
|
private |
Definition at line 200 of file CombinatorialOptimizer.h.
|
private |
Whether the maxima and minima have been properly initialized yet.
Definition at line 200 of file CombinatorialOptimizer.h.
|
private |
Definition at line 200 of file CombinatorialOptimizer.h.
|
private |
Neighbourhood function used to generate neighbours of currently selected topology during optimizations.
Definition at line 163 of file CombinatorialOptimizer.h.
|
private |
Handle to ros node for parameter access.
Definition at line 128 of file CombinatorialOptimizer.h.
|
private |
Optimization algorithm to be used.
Definition at line 168 of file CombinatorialOptimizer.h.
|
private |
Class used to print lines as headers, marked with dividers.
Definition at line 226 of file CombinatorialOptimizer.h.
|
private |
Probability that, in HillClimbing, a random restart is performed. Set to 0 for all other algorithms.
Definition at line 216 of file CombinatorialOptimizer.h.
|
private |
The probability above which a test set is considered as valid.
Definition at line 242 of file CombinatorialOptimizer.h.
|
private |
Starting topologies to perform optimization from.
Definition at line 143 of file CombinatorialOptimizer.h.
|
private |
list of all star topologies for the given object types.
Definition at line 133 of file CombinatorialOptimizer.h.
|
private |
How many test sets to use in optimization.
Definition at line 231 of file CombinatorialOptimizer.h.
|
private |
Topology Manager used to get fully meshed, star and starting topologies. If parameter "neighbourhood_function" from yaml is set to "TopologyManager", also used as neighbourhood function for optimization.
Definition at line 159 of file CombinatorialOptimizer.h.
|
private |
When test sets are loaded from a file, set this to true to select the recognition threshold based on the test sets.
Definition at line 221 of file CombinatorialOptimizer.h.
|
private |
The worst star topology. This pointer only gets set when it was requested via parameter get_worst_star_topology that only star topologies are compared (for testing purposes).
Definition at line 211 of file CombinatorialOptimizer.h.