2 #ifndef OPENGM_INTERSECTION_BASED_INF_HXX
3 #define OPENGM_INTERSECTION_BASED_INF_HXX
47 #include <vigra/adjacency_list_graph.hxx>
48 #include <vigra/merge_graph_adaptor.hxx>
49 #include <vigra/hierarchical_clustering.hxx>
50 #include <vigra/priority_queue.hxx>
51 #include <vigra/random.hxx>
52 #include <vigra/graph_algorithms.hxx>
62 template<
class INFERENCE,
class INTERSECTION_BASED,
class INTERSECTION_BASED_VISITOR>
68 : intersectionBased_(intersectionBased),
69 otherVisitor_(otherVisitor){
79 inf.arg(intersectionBased_._getArgRef());
80 intersectionBased_._setBestVal(inf.value());
81 return otherVisitor_(intersectionBased_);
84 void end(INFERENCE & inf){
89 void addLog(
const std::string & logName){
95 void log(
const std::string & logName,
const double logValue){
102 INTERSECTION_BASED & intersectionBased_;
103 INTERSECTION_BASED_VISITOR & otherVisitor_;
111 namespace proposal_gen{
113 template<
class G,
class VEC>
116 typedef typename G::Edge
Key;
117 typedef typename VEC::value_type
Value;
128 return vec_[graph_.id(key)];
131 return vec_[graph_.id(key)];
138 template<
class G,
class VEC>
141 typedef typename G::Node
Key;
142 typedef typename VEC::value_type
Value;
153 return vec_[graph_.id(key)];
156 return vec_[graph_.id(key)];
166 template<
class VALUE_TYPE>
184 const float noiseParam = 1.0,
185 const size_t seed = 42,
186 const bool ignoreSeed =
true,
187 const bool autoScale =
false,
188 const float permuteN = -1.0
212 randGen_(vigra::UInt32(param.seed_), param.ignoreSeed_),
213 calclulatedMinMax_(false){
217 void randomize(
const std::vector<ValueType> & weights, std::vector<ValueType> & rweights){
221 ValueType wmin = std::numeric_limits<ValueType>::infinity();
222 ValueType wmax =
static_cast<ValueType
>(-1.0)*std::numeric_limits<ValueType>::infinity();
223 for(
size_t i=0; i<rweights.size(); ++i){
224 wmin = std::min(weights[i], wmin);
225 wmax = std::max(weights[i], wmax);
227 ValueType range = wmax - wmin;
228 calclulatedMinMax_ =
true;
236 for(
size_t i=0; i<rweights.size(); ++i){
237 rweights[i] = weights[i] + randGen_.normal()*param_.
noiseParam_;
241 for(
size_t i=0; i<rweights.size(); ++i){
246 for(
size_t i=0; i<rweights.size(); ++i){
247 rweights[i] = weights[i]*randGen_.normal(1.0, param_.
noiseParam_);
251 std::copy(weights.begin(), weights.begin()+rweights.size(), rweights.begin());
265 for(
size_t p=0; p< nP; ++p){
266 size_t fi0 = randGen_.uniformInt(rweights.size());
267 size_t fi1 = randGen_.uniformInt(rweights.size());
269 std::swap(rweights[fi0], rweights[fi1]);
281 vigra::RandomNumberGenerator< > randGen_;
283 bool calclulatedMinMax_;
288 template<
class GM,
class ACC >
295 typedef vigra::AdjacencyListGraph
Graph;
302 typedef typename MergeGraph::Edge
Edge;
312 const float stopWeight = 0.0,
313 const float nodeNum = -1.0,
314 const float ignoreNegativeWeights =
false,
315 const bool setCutToZero =
false
338 pq_(graph.edgeNum()),
346 keep = std::max(0.0f, keep);
347 keep = std::min(1.0f, keep);
368 const std::vector<LabelType> & labels){
374 for(
size_t i=0; i<
graph_.edgeNum(); ++i){
379 for(
size_t i=0; i<
graph_.edgeNum(); ++i){
382 if(labels[u] == labels[v])
391 index_type minLabel =
pq_.top();
393 pq_.deleteItem(minLabel);
394 minLabel =
pq_.top();
396 return Edge(minLabel);
401 index_type minLabel =
pq_.top();
403 pq_.deleteItem(minLabel);
404 minLabel =
pq_.top();
406 return pq_.topPriority();
418 return doneByWeight || doneByNodeNum;
424 pq_.deleteItem(b.id());
428 pq_.deleteItem(edge.id());
433 vigra::ChangeablePriorityQueue< ValueType ,std::greater<ValueType> >
pq_;
440 template<
class GM,
class ACC>
447 typedef vigra::AdjacencyListGraph
Graph;
448 typedef vigra::MergeGraphAdaptor< Graph >
MGraph;
455 typedef vigra::HierarchicalClustering< Cop >
HC;
469 const float stopWeight = 0.0,
470 const float nodeStopNum = -1.0,
471 const bool ignoreNegativeWeights =
false,
472 const bool setCutToZero =
true
474 : CopParam(randomizer, stopWeight, nodeStopNum,setCutToZero)
487 weights_(gm.numberOfFactors(),ValueType(0.0)),
499 for(
size_t i=0; i<gm_.numberOfVariables();++i){
504 for(
size_t i=0; i<gm_.numberOfFactors(); ++i){
505 if(gm_[i].numberOfVariables()==2){
506 const ValueType val00 = gm_[i](lAA);
507 const ValueType val01 = gm_[i](lAB);
508 const ValueType weight = val01 - val00;
510 const GraphEdge gEdge = graph_.addEdge(gm_[i].variableIndex(0),gm_[i].variableIndex(1));
511 weights_[gEdge.id()]+=weight;
529 void getProposal(
const std::vector<LabelType> ¤t , std::vector<LabelType> &proposal){
535 mgraph_ =
new MGraph(graph_);
536 clusterOp_ =
new Cop(graph_, *mgraph_ , param_);
546 p.buildMergeTreeEncoding_=
false;
557 HC hc(*clusterOp_,p);
563 for(
size_t i=0; i< gm_.numberOfVariables(); ++i){
564 proposal[i] = hc.reprNodeId(i);
572 std::vector<ValueType> weights_;
573 vigra::AdjacencyListGraph graph_;
579 template<
class GM,
class ACC>
586 typedef vigra::AdjacencyListGraph
Graph;
591 typedef typename Graph:: template EdgeMap<ValueType>
WeightMap;
592 typedef typename Graph:: template EdgeMap<vigra::UInt32>
LabelMap;
603 const float seedFraction = 0.01,
604 const bool ignoreNegativeWeights =
false,
605 const bool seedFromNegativeEdges =
true,
631 wRandomizer_(param.randomizer_),
633 weights_(gm_.numberOfFactors()),
643 for(
size_t i=0; i<gm_.numberOfVariables();++i){
647 for(
size_t i=0; i<gm_.numberOfFactors(); ++i){
648 if(gm_[i].numberOfVariables()==2){
649 ValueType val00 = gm_[i](lAA);
650 ValueType val01 = gm_[i](lAB);
651 ValueType weight = val01 - val00;
653 const GraphEdge gEdge = graph_.addEdge(gm_[i].variableIndex(0),gm_[i].variableIndex(1));
654 weights_[gEdge.id()]+=weight;
657 negativeFactors_.push_back(i);
663 rWeights_.resize(graph_.edgeNum());
664 seeds_.resize(graph_.maxNodeId()+1);
673 void getProposal(
const std::vector<LabelType> ¤t , std::vector<LabelType> &proposal){
679 std::fill(seeds_.begin(), seeds_.end(), 0);
683 wRandomizer_.
randomize(weights_, rWeights_);
692 for(
size_t i=0; i<nSeeds; ++i){
693 const int randId = wRandomizer_.
randGen().uniformInt(graph_.nodeNum());
694 seeds_[randId] = i+1;
701 for(
size_t i=0; i<nSeeds/2; ++i){
702 const int randId = wRandomizer_.
randGen().uniformInt(negativeFactors_.size());
703 const IndexType fi = negativeFactors_[randId];
706 const IndexType vi0 = gm_[fi].variableIndex(0);
707 const IndexType vi1 = gm_[fi].variableIndex(1);
709 seeds_[vi0] = (2*i)+1;
710 seeds_[vi1] = (2*i+1)+1;
716 for(
size_t i=0; i<graph_.edgeNum(); ++i){
717 rWeights_[i] *= -1.0;
720 vigra::edgeWeightedWatershedsSegmentation(graph_, wMap, sMap, lMap);
725 WeightRand wRandomizer_;
727 std::vector<ValueType> weights_;
728 std::vector<ValueType> rWeights_;
729 std::vector<LabelType> seeds_;
730 std::vector<IndexType> negativeFactors_;
736 template<
class GM,
class ACC>
739 typedef ACC AccumulationType;
740 typedef GM GraphicalModelType;
743 typedef WeightRandomization<ValueType> WeightRand;
744 typedef typename WeightRand::Parameter WeightRandomizationParam;
750 const WeightRandomizationParam & randomizer = WeightRandomizationParam()
752 : randomizer_(randomizer)
756 WeightRandomizationParam randomizer_;
762 QpboBased(
const GM & gm,
const Parameter & param = Parameter())
769 weights_(gm.numberOfFactors()),
770 rweights_(gm.numberOfFactors()),
771 wRandomizer_(param_.randomizer_)
774 qpbo_ =
new kolmogorov::qpbo::QPBO<ValueType>(int(gm.numberOfVariables()),
775 int(gm.numberOfFactors()), NULL);
781 for(
size_t i=0; i<gm_.numberOfFactors(); ++i){
782 if(gm_[i].numberOfVariables()==2){
783 ValueType val00 = gm_[i](lAA);
784 ValueType val01 = gm_[i](lAB);
785 ValueType weight = val01 - val00;
796 size_t defaultNumStopIt() {
803 void getProposal(
const std::vector<LabelType> ¤t , std::vector<LabelType> &proposal){
815 wRandomizer_.randomize(weights_, rweights_);
818 qpbo_->AddNode(gm_.numberOfVariables());
821 for(
size_t i=0; i<gm_.numberOfFactors(); ++i){
822 if(gm_[i].numberOfVariables()==2){
827 const IndexType vi0 = gm_[i].variableIndex(0);
828 const IndexType vi1 = gm_[i].variableIndex(1);
830 if(current[vi0] == current[vi1]){
831 const ValueType weight = rweights_[i];
832 qpbo_->AddPairwiseTerm( vi0, vi1, 0.0, weight, weight, 0.0);
835 qpbo_->AddPairwiseTerm( vi0, vi1, 0.0, 0.0, 0.0, 0.0);
841 qpbo_->MergeParallelEdges();
844 qpbo_->SetLabel(0, 0);
849 for(IndexType vi=0; vi<gm_.numberOfVariables(); ++vi){
850 const int l = qpbo_->GetLabel(vi);
851 proposal[vi] = l ==-1 ? 0 : l ;
859 kolmogorov::qpbo::QPBO<ValueType> * qpbo_;
861 std::vector<ValueType> weights_;
862 std::vector<ValueType> rweights_;
863 WeightRand wRandomizer_;
1013 template<
class GM,
class PROPOSAL_GEN>
1043 const size_t numIt=1000,
1044 const size_t numStopIt = 0,
1045 const size_t parallelProposals = 1,
1046 const bool cgcFinalization =
false,
1047 const bool planar =
false,
1048 const bool doCutMove =
false,
1049 const bool acceptFirst =
true,
1050 const bool warmStart =
true,
1051 const std::vector<bool> & allowCutsWithin = std::vector<bool> ()
1085 std::string
name()
const;
1089 template<
class VisitorType>
1093 virtual ValueType
value()
const {
return bestValue_;}
1105 template<
class VisitorType>
1109 typedef FusionMoverType * FusionMoverTypePtr;
1110 typedef PROPOSAL_GEN * ProposalGenTypePtr;
1112 const GraphicalModelType &gm_;
1116 FusionMoverType * fusionMover_;
1117 FusionMoverTypePtr * fusionMoverArray_;
1120 PROPOSAL_GEN * proposalGen_;
1121 ProposalGenTypePtr * proposalGenArray_;
1123 ValueType bestValue_;
1124 std::vector<LabelType> bestArg_;
1128 typedef typename CgcInf::Parameter CgcParam;
1136 template<
class GM,
class PROPOSAL_GEN>
1139 const GraphicalModelType &gm,
1145 fusionMoverArray_(NULL),
1147 proposalGenArray_(NULL),
1150 bestArg_(gm_.numberOfVariables(), 0),
1151 maxOrder_(gm.factorOrder()),
1154 ACC::neutral(bestValue_);
1161 size_t nFuser = param_.parallelProposals_;
1163 proposalGenArray_ =
new ProposalGenTypePtr[nFuser];
1165 for(
size_t f=0; f<nFuser; ++f){
1166 fusionMoverArray_[f] =
new FusionMoverType(gm_,param_.fusionParam_);
1167 proposalGenArray_[f] =
new PROPOSAL_GEN(gm_, param_.proposalParam_);
1170 fusionMover_ = fusionMoverArray_[0];
1171 proposalGen_ = proposalGenArray_[0];
1173 if(!param_.warmStart_){
1175 std::vector<LabelType> conf(gm_.numberOfVariables(),0);
1176 setStartingPoint(conf.begin());
1183 for(
size_t fi=0; fi< gm_.numberOfFactors(); ++fi){
1184 if(gm_[fi].numberOfVariables()==2){
1186 const ValueType val00 = gm_[fi](lAA);
1187 const ValueType val01 = gm_[fi](lAB);
1188 const ValueType weight = val01 - val00;
1190 const size_t vi0 = gm_[fi].variableIndex(0);
1191 const size_t vi1 = gm_[fi].variableIndex(1);
1192 ufd.
merge(vi0, vi1);
1199 std::vector<LabelType> conf(gm_.numberOfVariables(),0);
1200 for(
IndexType vi=0; vi<gm_.numberOfVariables(); ++vi){
1201 conf[vi] = ufd.find(vi);
1203 setStartingPoint(conf.begin());
1209 if(param_.cgcFinalization_){
1211 cgcParam.
planar_ = param_.planar_;
1214 cgcInf_ =
new CgcInf(gm_, cgcParam);
1219 template<
class GM,
class PROPOSAL_GEN>
1222 for(
size_t f=0; f<param_.parallelProposals_; ++f){
1223 delete fusionMoverArray_[f];
1224 delete proposalGenArray_[f];
1227 delete[] fusionMoverArray_;
1228 delete[] proposalGenArray_;
1230 if(param_.cgcFinalization_){
1236 template<
class GM,
class PROPOSAL_GEN>
1243 template<
class GM,
class PROPOSAL_GEN>
1250 std::copy(begin, begin + gm_.numberOfVariables(), bestArg_.begin());
1251 bestValue_ = gm_.evaluate(bestArg_.begin());
1254 template<
class GM,
class PROPOSAL_GEN>
1258 return "IntersectionBasedInf";
1261 template<
class GM,
class PROPOSAL_GEN>
1268 template<
class GM,
class PROPOSAL_GEN>
1275 template<
class GM,
class PROPOSAL_GEN>
1276 template<
class VisitorType>
1279 VisitorType &visitor
1281 visitor.begin(*
this);
1283 if(param_.cgcFinalization_){
1288 cgcInf_->setStartingPoint(bestArg_.begin());
1289 cgcInf_->infer(redirectingVisitor);
1290 cgcInf_->arg(bestArg_);
1291 bestValue_ = gm_.evaluate(bestArg_);
1298 template<
class GM,
class PROPOSAL_GEN>
1299 template<
class VisitorType>
1302 VisitorType &visitor
1306 bestValue_ = gm_.evaluate(bestArg_.begin());
1311 if(param_.numStopIt_ == 0){
1312 param_.numStopIt_ = proposalGen_->defaultNumStopIt();
1315 std::vector<LabelType> proposedState(gm_.numberOfVariables());
1316 std::vector<LabelType> fusedState(gm_.numberOfVariables());
1318 size_t countRoundsWithNoImprovement = 0;
1321 size_t nFuser = param_.parallelProposals_;
1323 std::vector< std::vector<LabelType> > pVec;
1324 std::vector< std::vector<LabelType> > rVec;
1326 std::vector<ValueType> vVec;
1327 std::vector<bool> dVec;
1329 pVec.resize(nFuser);
1330 rVec.resize(nFuser);
1331 vVec.resize(nFuser);
1332 dVec.resize(nFuser);
1333 for(
size_t i=0; i<nFuser; ++i){
1334 pVec[i].resize(gm_.numberOfVariables());
1335 rVec[i].resize(gm_.numberOfVariables());
1340 const bool mmcv = param_.allowCutsWithin_.size()>0;
1342 for(
size_t iteration=0; iteration<param_.numIt_; ++iteration){
1344 if(mmcv && iteration == 0){
1345 ACC::neutral(bestValue_);
1348 else if(!mmcv && iteration == 0 && param_.acceptFirst_ && !param_.warmStart_){
1349 proposalGen_->getProposal(bestArg_,proposedState);
1350 std::copy(proposedState.begin(), proposedState.end(), bestArg_.begin());
1351 bestValue_ = gm_.evaluate(bestArg_);
1352 if(visitor(*
this)!=0){
1359 const ValueType valueBeforeRound = bestValue_;
1365 proposalGen_->getProposal(bestArg_,proposedState);
1366 ValueType proposalValue = gm_.evaluate(proposedState);
1368 ACC::neutral(proposalValue);
1373 anyVar = fusionMover_->fuse(bestArg_,proposedState, fusedState,
1374 bestValue_, proposalValue, bestValue_);
1384 if(!param_.storagePrefix_.empty()){
1387 std::stringstream ss;
1388 ss<<param_.storagePrefix_<<iteration<<
"proposal.txt";
1389 std::ofstream f(ss.str().c_str());
1390 for(
size_t i=0; i<gm_.numberOfVariables(); ++i) {
1391 f << proposedState[i] <<
'\n';
1395 std::stringstream ss;
1396 ss<<param_.storagePrefix_<<iteration<<
"cbest.txt";
1397 std::ofstream f(ss.str().c_str());
1398 for(
size_t i=0; i<gm_.numberOfVariables(); ++i) {
1399 f << bestArg_[i] <<
'\n';
1403 std::stringstream ss;
1404 ss<<param_.storagePrefix_<<iteration<<
"nbest.txt";
1405 std::ofstream f(ss.str().c_str());
1406 for(
size_t i=0; i<gm_.numberOfVariables(); ++i) {
1407 f << fusedState[i] <<
'\n';
1421 #pragma omp parallel for
1422 for(
size_t i=0; i<nFuser; ++i){
1427 proposalGenArray_[i]->getProposal(bestArg_,pVec[i]);
1428 bool tmp = fusionMoverArray_[i]->fuse(bestArg_,pVec[i], rVec[i],
1429 bestValue_, gm_.evaluate(pVec[i]), vVec[i]);
1430 if(bestValue_ < vVec[i]){
1435 size_t total = nFuser;
1440 for(
size_t i=0; i<total; ++i){
1442 pVec[left] = rVec[i];
1446 if(left == 0 && c == 0){
1449 else if(left==0 || left == 1){
1450 fusedState = rVec[0];
1451 bestValue_ = vVec[0];
1456 #pragma omp parallel for
1457 for(
size_t i=0; i<left; i+=2){
1462 bool tmp = fusionMoverArray_[i]->fuse(
1463 pVec[i],pVec[i+1],rVec[i],
1464 gm_.evaluate(pVec[i]),
1465 gm_.evaluate(pVec[i+1]),
1481 if( !ACC::bop(bestValue_, valueBeforeRound)){
1482 ++countRoundsWithNoImprovement;
1486 countRoundsWithNoImprovement = 0;
1487 bestArg_ = fusedState;
1489 if(visitor(*
this)!=0){
1494 if(visitor(*
this)!=0){
1497 ++countRoundsWithNoImprovement;
1500 if(countRoundsWithNoImprovement==param_.numStopIt_ && param_.numStopIt_ !=0 ){
1510 template<
class GM,
class PROPOSAL_GEN>
1514 std::vector<LabelType> &x,
1520 x.resize(gm_.numberOfVariables());
1521 for (
size_t j = 0; j < x.size(); ++j)
1535 #endif // #ifndef OPENGM_INTERSECTION_BASED_INF_HXX
void eraseEdge(const Edge &edge)
WeightRandomizationParam randomizer_
void addLog(const std::string &logName)
WeightRandomization(const Parameter ¶m=Parameter())
const GraphicalModelType & graphicalModel() const
Graph::template EdgeMap< ValueType > WeightMap
RandomizedWatershed(const GM &gm, const Parameter ¶m=Parameter())
bool ignoreNegativeWeights_
void getProposal(const std::vector< LabelType > ¤t, std::vector< LabelType > &proposal)
VectorViewNodeMap(const G &g, VEC &vec)
void merge(value_type, value_type)
Merge two sets.
vigra::MergeGraphAdaptor< Graph > MergeGraph
MergeGraph & mergeGraph()
get a reference to the merge
Parameter(const ProposalParameter &proposalParam=ProposalParameter(), const FusionParameter &fusionParam=FusionParameter(), const size_t numIt=1000, const size_t numStopIt=0, const size_t parallelProposals=1, const bool cgcFinalization=false, const bool planar=false, const bool doCutMove=false, const bool acceptFirst=true, const bool warmStart=true, const std::vector< bool > &allowCutsWithin=std::vector< bool >())
WeightRand::Parameter WeightRandomizationParam
vigra::RandomNumberGenerator< > & randGen()
std::vector< bool > allowCutsWithin_
void mergeEdges(const Edge &a, const Edge &b)
IntersectionBasedInf(const GraphicalModelType &, const Parameter &=Parameter())
WeightType contractionWeight()
get the edge weight of the edge which should be contracted next
opengm::visitors::VerboseVisitor< IntersectionBasedInf< GM, PROPOSAL_GEN > > VerboseVisitorType
void getProposal(const std::vector< LabelType > ¤t, std::vector< LabelType > &proposal)
size_t operator()(INFERENCE &inf)
vigra::AdjacencyListGraph Graph
VEC::const_reference ConstReference
std::vector< ValueType > rWeights_
vigra::ChangeablePriorityQueue< ValueType,std::greater< ValueType > > pq_
InferenceTermination infer()
FusionMoverType::Parameter FusionParameter
opengm::visitors::EmptyVisitor< IntersectionBasedInf< GM, PROPOSAL_GEN > > EmptyVisitorType
ConstReference operator[](const Key &key) const
std::string storagePrefix_
vigra::HierarchicalClustering< Cop > HC
void randomize(const std::vector< ValueType > &weights, std::vector< ValueType > &rweights)
ProposalGen::Parameter ProposalParameter
RandMcClusterOp< GM, ACC > Cop
GraphicalModelType::IndexType IndexType
Parameter(const WeightRandomizationParam &randomizer=WeightRandomizationParam(), const float stopWeight=0.0, const float nodeNum=-1.0, const float ignoreNegativeWeights=false, const bool setCutToZero=false)
ProposalParameter proposalParam_
FusionParameter fusionParam_
RandMcClusterOp(const Graph &graph, MergeGraph &mergegraph, const Parameter ¶m)
size_t defaultNumStopIt()
VectorViewEdgeMap(const G &g, VEC &vec)
Reference operator[](const Key &key)
ConstReference operator[](const Key &key) const
size_t defaultNumStopIt()
float ignoreNegativeWeights_
PermutableLabelFusionMove< GraphicalModelType, AccumulationType > FusionMoverType
vigra::MergeGraphAdaptor< Graph > MGraph
WeightRandomization< ValueType > WeightRand
Inference algorithm interface.
void setStartingPoint(typename std::vector< LabelType >::const_iterator)
set initial labeling
ProposalGen::AccumulationType AccumulationType
void log(const std::string &logName, const double logValue)
Graph::template EdgeMap< vigra::UInt32 > LabelMap
virtual InferenceTermination arg(std::vector< LabelType > &, const size_t=1) const
output a solution
virtual ValueType value() const
return the solution (value)
VEC::const_reference ConstReference
std::vector< LabelType > & _getArgRef()
Parameter(const WeightRandomizationParam &randomizer=WeightRandomizationParam(), const float stopWeight=0.0, const float nodeStopNum=-1.0, const bool ignoreNegativeWeights=false, const bool setCutToZero=true)
vigra::AdjacencyListGraph Graph
Disjoint set data structure with path compression.
bool seedFromNegativeEdges_
WeightRandomization< ValueType > WeightRand
size_t parallelProposals_
Parameter(const NoiseType noiseType=NormalAdd, const float noiseParam=1.0, const size_t seed=42, const bool ignoreSeed=true, const bool autoScale=false, const float permuteN=-1.0)
GraphicalModelType::LabelType LabelType
Reference operator[](const Key &key)
#define OPENGM_GM_TYPE_TYPEDEFS
WeightRandomizationParam randomizer_
Parameter(const float seedFraction=0.01, const bool ignoreNegativeWeights=false, const bool seedFromNegativeEdges=true, const WeightRandomizationParam randomizer=WeightRandomizationParam())
~RandomizedHierarchicalClustering()
void _setBestVal(const ValueType value)
WeightRand::Parameter WeightRandomizationParam
void setWeights(const std::vector< ValueType > &weights, const std::vector< LabelType > &labels)
RandomizedHierarchicalClustering(const GM &gm, const Parameter ¶m=Parameter())
opengm::visitors::TimingVisitor< IntersectionBasedInf< GM, PROPOSAL_GEN > > TimingVisitorType
vigra::AdjacencyListGraph Graph
CgcRedirectingVisitor(INTERSECTION_BASED &intersectionBased, INTERSECTION_BASED_VISITOR &otherVisitor)
void begin(INFERENCE &inf)
WeightRand::Parameter WeightRandomizationParam
WeightRandomization< ValueType > WeightRand