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::SumProdTRWS< GM, ACC > Class Template Reference

#include <trws_base.hxx>

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

Public Types

typedef TRWSPrototype< SumProdSolver< GM, ACC, typename std::vector< typename GM::ValueType >::const_iterator > > parent
 
typedef ACC AccumulationType
 
typedef GM GraphicalModelType
 
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 SequenceStorage< GMSubModel
 
typedef DecompositionStorage< GMStorage
 
typedef parent::OutputContainerType OutputContainerType
 
typedef OutputContainerType::iterator OutputIteratorType
 
typedef SumProdTRWS_Parameters< ValueTypeParameters
 
- Public Types inherited from opengm::trws_base::TRWSPrototype< SumProdSolver< GM, ACC, std::vector< GM::ValueType >::const_iterator > >
typedef SumProdSolver< GM, ACC, std::vector< GM::ValueType >::const_iterator >::GMType GM
 
typedef GM GraphicalModelType
 
typedef SumProdSolver< GM, ACC, std::vector< GM::ValueType >::const_iterator >::ACCType ACC
 
typedef ACC AccumulationType
 
typedef SumProdSolver< GM, ACC, std::vector< GM::ValueType >::const_iterator > SubSolverType
 
typedef FunctionParameters< GMFactorProperties
 
typedef visitors::EmptyVisitor< TRWSPrototype< SubSolverType > > EmptyVisitorParent
 
typedef visitors::VisitorWrapper< EmptyVisitorParent, TRWSPrototype< SumProdSolver< GM, ACC, std::vector< GM::ValueType >::const_iterator > > > EmptyVisitorType
 
typedef SumProdSolver< 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

 SumProdTRWS (Storage &storage, const Parameters &params)
 
 ~SumProdTRWS ()
 
void SetSmoothing (ValueType smoothingValue)
 
ValueType GetSmoothing () const
 
bool ConvergenceFlag () const
 
std::pair< ValueType, ValueTypeGetMarginals (IndexType variable, OutputIteratorType begin)
 
ValueType GetMarginalsAndDerivativeMove ()
 
ValueType getDerivative (size_t i) const
 

besides computation of marginals returns derivative w.r.t. _smoothingValue

More...
 
template<class ITERATOR >
void GetMarginalsForSubModel (IndexType modelId, IndexType localVarId, ITERATOR begin)
 
- Public Member Functions inherited from opengm::trws_base::TRWSPrototype< SumProdSolver< 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)
 
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 ()
 
bool _CheckConvergence (ValueType relativeThreshold)
 
- Protected Member Functions inherited from opengm::trws_base::TRWSPrototype< SumProdSolver< 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, SumProdSolver< 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 _CheckStoppingCondition (InferenceTermination *pterminationCode)
 
virtual void _EstimateTRWSBound ()
 

Protected Attributes

bool _bDualConverged
 
ValueType _smoothingValue
 
- Protected Attributes inherited from opengm::trws_base::TRWSPrototype< SumProdSolver< 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< SumProdSolver< 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::SumProdTRWS< GM, ACC >

Definition at line 353 of file trws_base.hxx.

Member Typedef Documentation

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

Definition at line 357 of file trws_base.hxx.

Definition at line 360 of file trws_base.hxx.

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

Definition at line 358 of file trws_base.hxx.

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

Definition at line 362 of file trws_base.hxx.

Definition at line 364 of file trws_base.hxx.

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

Definition at line 363 of file trws_base.hxx.

Definition at line 367 of file trws_base.hxx.

template<class GM, class ACC>
typedef OutputContainerType::iterator opengm::trws_base::SumProdTRWS< GM, ACC >::OutputIteratorType

Definition at line 368 of file trws_base.hxx.

template<class GM, class ACC>
typedef SumProdTRWS_Parameters<ValueType> opengm::trws_base::SumProdTRWS< GM, ACC >::Parameters

Definition at line 370 of file trws_base.hxx.

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

Definition at line 356 of file trws_base.hxx.

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

Definition at line 366 of file trws_base.hxx.

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

Definition at line 365 of file trws_base.hxx.

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

Definition at line 359 of file trws_base.hxx.

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

Definition at line 361 of file trws_base.hxx.

Constructor & Destructor Documentation

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

Definition at line 372 of file trws_base.hxx.

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

Definition at line 385 of file trws_base.hxx.

Member Function Documentation

template<class GM, class ACC>
bool opengm::trws_base::SumProdTRWS< GM, ACC >::_CheckConvergence ( ValueType  relativeThreshold)
inlineprotectedvirtual

Reimplemented from opengm::trws_base::TRWSPrototype< SumProdSolver< GM, ACC, std::vector< GM::ValueType >::const_iterator > >.

Definition at line 430 of file trws_base.hxx.

+ Here is the call graph for this function:

template<class GM , class ACC >
void opengm::trws_base::SumProdTRWS< GM, ACC >::_InitMove ( )
protectedvirtual

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

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

Definition at line 1242 of file trws_base.hxx.

+ Here is the caller graph for this function:

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

D not needed

Definition at line 1249 of file trws_base.hxx.

+ Here is the call graph for this function:

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

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

Definition at line 1259 of file trws_base.hxx.

+ Here is the call graph for this function:

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

Definition at line 1265 of file trws_base.hxx.

template<class GM, class ACC>
bool opengm::trws_base::SumProdTRWS< GM, ACC >::ConvergenceFlag ( ) const
inline

Definition at line 397 of file trws_base.hxx.

template<class GM, class ACC>
ValueType opengm::trws_base::SumProdTRWS< GM, ACC >::getDerivative ( size_t  i) const
inline

besides computation of marginals returns derivative w.r.t. _smoothingValue

Definition at line 400 of file trws_base.hxx.

template<class GM , class ACC >
std::pair< typename SumProdTRWS< GM, ACC >::ValueType, typename SumProdTRWS< GM, ACC >::ValueType > opengm::trws_base::SumProdTRWS< GM, ACC >::GetMarginals ( IndexType  variable,
OutputIteratorType  begin 
)
virtual

Reimplemented from opengm::trws_base::TRWSPrototype< SumProdSolver< GM, ACC, std::vector< GM::ValueType >::const_iterator > >.

Definition at line 1272 of file trws_base.hxx.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

template<class GM , class ACC >
SumProdTRWS< GM, ACC >::ValueType opengm::trws_base::SumProdTRWS< GM, ACC >::GetMarginalsAndDerivativeMove ( )

Definition at line 1308 of file trws_base.hxx.

template<class GM, class ACC>
template<class ITERATOR >
void opengm::trws_base::SumProdTRWS< GM, ACC >::GetMarginalsForSubModel ( IndexType  modelId,
IndexType  localVarId,
ITERATOR  begin 
)
inline

Definition at line 414 of file trws_base.hxx.

+ Here is the call graph for this function:

template<class GM, class ACC>
ValueType opengm::trws_base::SumProdTRWS< GM, ACC >::GetSmoothing ( ) const
inline

Definition at line 392 of file trws_base.hxx.

+ Here is the caller graph for this function:

template<class GM, class ACC>
void opengm::trws_base::SumProdTRWS< GM, ACC >::SetSmoothing ( ValueType  smoothingValue)
inline

Definition at line 391 of file trws_base.hxx.

+ Here is the call graph for this function:

Member Data Documentation

template<class GM, class ACC>
bool opengm::trws_base::SumProdTRWS< GM, ACC >::_bDualConverged
protected

Definition at line 430 of file trws_base.hxx.

template<class GM, class ACC>
ValueType opengm::trws_base::SumProdTRWS< GM, ACC >::_smoothingValue
protected

Definition at line 433 of file trws_base.hxx.