OpenGM  2.3.x
Discrete Graphical Model Library
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
opengm::trws_base::MaxSumTRWS< GM, ACC > Class Template Reference

#include <trws_base.hxx>

+ Inheritance diagram for opengm::trws_base::MaxSumTRWS< GM, ACC >:
+ Collaboration diagram for opengm::trws_base::MaxSumTRWS< GM, ACC >:

Public Types

typedef TRWSPrototype< MaxSumSolver< GM, ACC, typename std::vector< typename GM::ValueType >::const_iterator > > parent
 
typedef parent::SubSolverType SubSolver
 
typedef parent::const_marginals_iterators_pair const_marginals_iterators_pair
 
typedef parent::ValueType ValueType
 
typedef parent::IndexType IndexType
 
typedef parent::LabelType LabelType
 
typedef parent::InferenceTermination InferenceTermination
 
typedef parent::EmptyVisitorType EmptyVisitorType
 
typedef parent::UnaryFactor UnaryFactor
 
typedef ACC AccumulationType
 
typedef GM GraphicalModelType
 
typedef parent::OutputContainerType OutputContainerType
 
typedef SequenceStorage< GMSubModel
 
typedef DecompositionStorage< GMStorage
 
typedef MaxSumTRWS_Parameters< ValueTypeParameters
 
- Public Types inherited from opengm::trws_base::TRWSPrototype< MaxSumSolver< GM, ACC, std::vector< GM::ValueType >::const_iterator > >
typedef MaxSumSolver< GM, ACC, std::vector< GM::ValueType >::const_iterator >::GMType GM
 
typedef GM GraphicalModelType
 
typedef MaxSumSolver< GM, ACC, std::vector< GM::ValueType >::const_iterator >::ACCType ACC
 
typedef ACC AccumulationType
 
typedef MaxSumSolver< GM, ACC, std::vector< GM::ValueType >::const_iterator > SubSolverType
 
typedef FunctionParameters< GMFactorProperties
 
typedef visitors::EmptyVisitor< TRWSPrototype< SubSolverType > > EmptyVisitorParent
 
typedef visitors::VisitorWrapper< EmptyVisitorParent, TRWSPrototype< MaxSumSolver< GM, ACC, std::vector< GM::ValueType >::const_iterator > > > EmptyVisitorType
 
typedef MaxSumSolver< GM, ACC, std::vector< GM::ValueType >::const_iterator >::const_iterators_pair const_marginals_iterators_pair
 
typedef GM::ValueType ValueType
 
typedef GM::IndexType IndexType
 
typedef GM::LabelType LabelType
 
typedef opengm::InferenceTermination InferenceTermination
 
typedef std::vector< ValueTypeOutputContainerType
 
typedef OutputContainerType::iterator OutputIteratorType
 
typedef TRWSPrototype_Parameters< ValueTypeParameters
 
typedef SequenceStorage< GMSubModel
 
typedef DecompositionStorage< GMStorage
 
typedef Storage::UnaryFactor UnaryFactor
 

Public Member Functions

 MaxSumTRWS (Storage &storage, const Parameters &params)
 
 ~MaxSumTRWS ()
 
void getTreeAgreement (std::vector< bool > &out, std::vector< LabelType > *plabeling=0, std::vector< std::vector< LabelType > > *ptreeLabelings=0)
 
bool CheckTreeAgreement (InferenceTermination *pterminationCode)
 
- Public Member Functions inherited from opengm::trws_base::TRWSPrototype< MaxSumSolver< GM, ACC, std::vector< GM::ValueType >::const_iterator > >
 TRWSPrototype (Storage &storage, const Parameters &params)
 
virtual ~TRWSPrototype ()
 
virtual ValueType GetBestIntegerBound () const
 
virtual ValueType value () const
 
virtual ValueType bound () const
 
virtual const std::vector< LabelType > & arg () const
 
bool CheckDualityGap (ValueType primalBound, ValueType dualBound)
 
virtual std::pair< ValueType, ValueTypeGetMarginals (IndexType variable, OutputIteratorType begin)
 
void GetMarginalsMove ()
 >returns "averaged" over subsolvers marginals More...
 
void BackwardMove ()
 
ValueType getBound (size_t i) const
 
virtual InferenceTermination infer ()
 
InferenceTermination infer (VISITOR &)
 
void ForwardMove ()
 
void EstimateIntegerLabelingAndBound ()
 
ValueType lastDualUpdate () const
 
InferenceTermination infer_visitor_updates (VISITOR &visitor, size_t *pinterCounter=0)
 
InferenceTermination core_infer (size_t *piterCounter=0)
 
const FactorPropertiesgetFactorProperties () const
 

Protected Member Functions

void _SumUpForwardMarginals (std::vector< ValueType > *pout, const_marginals_iterators_pair itpair)
 
void _postprocessMarginals (typename std::vector< ValueType >::iterator begin, typename std::vector< ValueType >::iterator end)
 
void _normalizeMarginals (typename std::vector< ValueType >::iterator begin, typename std::vector< ValueType >::iterator end, SubSolver *subSolver)
 
void _InitMove ()
 
void _EstimateTRWSBound ()
 
bool _CheckStoppingCondition (InferenceTermination *pterminationCode)
 
- Protected Member Functions inherited from opengm::trws_base::TRWSPrototype< MaxSumSolver< GM, ACC, std::vector< GM::ValueType >::const_iterator > >
void _EstimateIntegerLabeling ()
 
InferenceTermination _core_infer (VISITOR &visitor, size_t *piterCounter=0)
 
virtual ValueType _GetPrimalBound ()
 
virtual void _normalizeMarginals (typename std::vector< ValueType >::iterator begin, typename std::vector< ValueType >::iterator end, MaxSumSolver< GM, ACC, std::vector< GM::ValueType >::const_iterator > *subSolver)=0
 
void _EvaluateIntegerBounds ()
 
virtual void _SumUpForwardMarginals (std::vector< ValueType > *pout, const_marginals_iterators_pair itpair)=0
 
void _EstimateIntegerLabel (IndexType varId, const std::vector< ValueType > &sumMarginal)
 
void _InitSubSolvers ()
 >best label index More...
 
void _ForwardMove ()
 
void _FinalizeMove ()
 
ValueType _GetObjectiveValue ()
 
IndexType _order (IndexType i)
 
IndexType _core_order (IndexType i, IndexType totalSize)
 
virtual bool _CheckConvergence (ValueType relativeThreshold)
 

Protected Attributes

Parameters _parameters
 
ValueType _pseudoBoundValue
 
size_t _localConsistencyCounter
 
std::vector< bool_treeAgree
 
std::vector< bool_mask
 
std::vector< bool_nodeMask
 
size_t _agree_count
 
size_t _treeAgree_iterationCounter
 
- Protected Attributes inherited from opengm::trws_base::TRWSPrototype< MaxSumSolver< GM, ACC, std::vector< GM::ValueType >::const_iterator > >
Storage_storage
 
FactorProperties _factorProperties
 
PreviousFactorTable< GM_ftable
 
Parameters _parameters
 
ValueType _dualBound
 
ValueType _oldDualBound
 >current dual bound (it is improved monotonically) More...
 
ValueType _lastDualUpdate
 

previous dual bound (it is improved monotonically)

More...
 
SubModel::MoveDirection _moveDirection
 
std::vector< MaxSumSolver< GM, ACC, std::vector< GM::ValueType >::const_iterator > * > _subSolvers
 
std::vector< std::vector< ValueType > > _marginals
 computation optimization More...
 
ValueType _integerBound
 
ValueType _bestIntegerBound
 
std::vector< LabelType_integerLabeling
 
std::vector< LabelType_bestIntegerLabeling
 
std::vector< ValueType_sumMarginal
 
FactorProperties::ParameterStorageType _factorParameters
 

Detailed Description

template<class GM, class ACC>
class opengm::trws_base::MaxSumTRWS< GM, ACC >

Definition at line 466 of file trws_base.hxx.

Member Typedef Documentation

template<class GM , class ACC >
typedef ACC opengm::trws_base::MaxSumTRWS< GM, ACC >::AccumulationType

Definition at line 479 of file trws_base.hxx.

Definition at line 472 of file trws_base.hxx.

template<class GM , class ACC >
typedef parent::EmptyVisitorType opengm::trws_base::MaxSumTRWS< GM, ACC >::EmptyVisitorType

Definition at line 477 of file trws_base.hxx.

template<class GM , class ACC >
typedef GM opengm::trws_base::MaxSumTRWS< GM, ACC >::GraphicalModelType

Definition at line 480 of file trws_base.hxx.

template<class GM , class ACC >
typedef parent::IndexType opengm::trws_base::MaxSumTRWS< GM, ACC >::IndexType

Definition at line 474 of file trws_base.hxx.

Definition at line 476 of file trws_base.hxx.

template<class GM , class ACC >
typedef parent::LabelType opengm::trws_base::MaxSumTRWS< GM, ACC >::LabelType

Definition at line 475 of file trws_base.hxx.

Definition at line 481 of file trws_base.hxx.

template<class GM , class ACC >
typedef MaxSumTRWS_Parameters<ValueType> opengm::trws_base::MaxSumTRWS< GM, ACC >::Parameters

Definition at line 487 of file trws_base.hxx.

template<class GM , class ACC >
typedef TRWSPrototype<MaxSumSolver<GM,ACC,typename std::vector<typename GM::ValueType>::const_iterator> > opengm::trws_base::MaxSumTRWS< GM, ACC >::parent

Definition at line 469 of file trws_base.hxx.

template<class GM , class ACC >
typedef DecompositionStorage<GM> opengm::trws_base::MaxSumTRWS< GM, ACC >::Storage

Definition at line 485 of file trws_base.hxx.

template<class GM , class ACC >
typedef SequenceStorage<GM> opengm::trws_base::MaxSumTRWS< GM, ACC >::SubModel

Definition at line 484 of file trws_base.hxx.

template<class GM , class ACC >
typedef parent::SubSolverType opengm::trws_base::MaxSumTRWS< GM, ACC >::SubSolver

Definition at line 471 of file trws_base.hxx.

template<class GM , class ACC >
typedef parent::UnaryFactor opengm::trws_base::MaxSumTRWS< GM, ACC >::UnaryFactor

Definition at line 478 of file trws_base.hxx.

template<class GM , class ACC >
typedef parent::ValueType opengm::trws_base::MaxSumTRWS< GM, ACC >::ValueType

Definition at line 473 of file trws_base.hxx.

Constructor & Destructor Documentation

template<class GM , class ACC >
opengm::trws_base::MaxSumTRWS< GM, ACC >::MaxSumTRWS ( Storage storage,
const Parameters params 
)
inline

Definition at line 489 of file trws_base.hxx.

template<class GM , class ACC >
opengm::trws_base::MaxSumTRWS< GM, ACC >::~MaxSumTRWS ( )
inline

Definition at line 505 of file trws_base.hxx.

Member Function Documentation

template<class GM , class ACC >
bool opengm::trws_base::MaxSumTRWS< GM, ACC >::_CheckStoppingCondition ( InferenceTermination pterminationCode)
protectedvirtual
template<class GM , class ACC >
void opengm::trws_base::MaxSumTRWS< GM, ACC >::_EstimateTRWSBound ( )
protectedvirtual
template<class GM , class ACC >
void opengm::trws_base::MaxSumTRWS< GM, ACC >::_InitMove ( )
protectedvirtual

< calling ->InitMove() for each element of the container

Implements opengm::trws_base::TRWSPrototype< MaxSumSolver< GM, ACC, std::vector< GM::ValueType >::const_iterator > >.

Definition at line 1107 of file trws_base.hxx.

template<class GM , class ACC >
void opengm::trws_base::MaxSumTRWS< GM, ACC >::_normalizeMarginals ( typename std::vector< ValueType >::iterator  begin,
typename std::vector< ValueType >::iterator  end,
SubSolver subSolver 
)
protected

Definition at line 1144 of file trws_base.hxx.

+ Here is the call graph for this function:

template<class GM , class ACC >
void opengm::trws_base::MaxSumTRWS< GM, ACC >::_postprocessMarginals ( typename std::vector< ValueType >::iterator  begin,
typename std::vector< ValueType >::iterator  end 
)
protectedvirtual

Implements opengm::trws_base::TRWSPrototype< MaxSumSolver< GM, ACC, std::vector< GM::ValueType >::const_iterator > >.

Definition at line 1114 of file trws_base.hxx.

+ Here is the call graph for this function:

template<class GM , class ACC >
void opengm::trws_base::MaxSumTRWS< GM, ACC >::_SumUpForwardMarginals ( std::vector< ValueType > *  pout,
const_marginals_iterators_pair  itpair 
)
protected

Definition at line 1120 of file trws_base.hxx.

template<class GM , class ACC >
bool opengm::trws_base::MaxSumTRWS< GM, ACC >::CheckTreeAgreement ( InferenceTermination pterminationCode)

Definition at line 1187 of file trws_base.hxx.

template<class GM , class ACC >
void opengm::trws_base::MaxSumTRWS< GM, ACC >::getTreeAgreement ( std::vector< bool > &  out,
std::vector< LabelType > *  plabeling = 0,
std::vector< std::vector< LabelType > > *  ptreeLabelings = 0 
)

Definition at line 1152 of file trws_base.hxx.

+ Here is the caller graph for this function:

Member Data Documentation

template<class GM , class ACC >
size_t opengm::trws_base::MaxSumTRWS< GM, ACC >::_agree_count
protected

Definition at line 528 of file trws_base.hxx.

template<class GM , class ACC >
size_t opengm::trws_base::MaxSumTRWS< GM, ACC >::_localConsistencyCounter
protected

Definition at line 520 of file trws_base.hxx.

template<class GM , class ACC >
std::vector<bool> opengm::trws_base::MaxSumTRWS< GM, ACC >::_mask
protected

Definition at line 525 of file trws_base.hxx.

template<class GM , class ACC >
std::vector<bool> opengm::trws_base::MaxSumTRWS< GM, ACC >::_nodeMask
protected

Definition at line 526 of file trws_base.hxx.

template<class GM , class ACC >
Parameters opengm::trws_base::MaxSumTRWS< GM, ACC >::_parameters
protected

Definition at line 517 of file trws_base.hxx.

template<class GM , class ACC >
ValueType opengm::trws_base::MaxSumTRWS< GM, ACC >::_pseudoBoundValue
protected

Definition at line 519 of file trws_base.hxx.

template<class GM , class ACC >
std::vector<bool> opengm::trws_base::MaxSumTRWS< GM, ACC >::_treeAgree
protected

Definition at line 524 of file trws_base.hxx.

template<class GM , class ACC >
size_t opengm::trws_base::MaxSumTRWS< GM, ACC >::_treeAgree_iterationCounter
protected

Definition at line 529 of file trws_base.hxx.