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

#include <trws_subproblemsolver.hxx>

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

Public Types

typedef DynamicProgramming< GM, ACC, InputIterator > parent
 
typedef parent::ValueType ValueType
 
typedef parent::IndexType IndexType
 
typedef parent::LabelType LabelType
 
typedef parent::InputIteratorType InputIteratorType
 
typedef parent::const_iterators_pair const_iterators_pair
 
typedef parent::Storage Storage
 
typedef parent::MoveDirection MoveDirection
 
typedef parent::UnaryFactor UnaryFactor
 
typedef parent::FactorProperties FactorProperties
 
- Public Types inherited from opengm::trws_base::DynamicProgramming< GM, ACC, InputIterator >
typedef GM GMType
 
typedef ACC ACCType
 
typedef GM::ValueType ValueType
 
typedef GM::IndexType IndexType
 
typedef GM::LabelType LabelType
 
typedef InputIterator InputIteratorType
 
typedef SequenceStorage< GM > Storage
 
typedef Storage::IndexList IndexList
 
typedef Storage::UnaryFactor UnaryFactor
 
typedef Storage::MoveDirection MoveDirection
 
typedef std::vector< IndexListIndexTable
 
typedef FunctionParameters< GM > FactorProperties
 
typedef UnaryFactor::const_iterator ConstIterator
 
typedef GM::FactorType Factor
 
typedef std::pair< typename UnaryFactor::const_iterator, typename UnaryFactor::const_iterator > const_iterators_pair
 

Public Member Functions

 SumProdSolver (Storage &storage, const FactorProperties &factorProperties, bool fastComputations=true)
 
void InitMove (ValueType rho)
 
void InitMove (ValueType rho, MoveDirection movedirection)
 
ValueType ComputeObjectiveValue ()
 
ValueType MoveBackGetDerivative ()
 
ValueType getDerivative () const
 >makes MoveBack and returns derivative w.r.t. _smoothingValue More...
 
- Public Member Functions inherited from opengm::trws_base::DynamicProgramming< GM, ACC, InputIterator >
 DynamicProgramming (Storage &storage, const FactorProperties &factorProperties, bool fastComputations=true)
 
virtual ~DynamicProgramming ()
 
void InitMove ()
 
void InitMove (MoveDirection movedirection)
 
virtual void InitReverseMove ()
 
virtual void Move ()
 >initializes move, which is reverse to the current one//TODO: remove virtual ? More...
 
virtual void PushBack ()
 
virtual void MoveBack ()
 
const_iterators_pair GetMarginals () const
 
const_iterators_pair GetMarginals (IndexType indx) const
 
ValueType GetObjectiveValue () const
 
virtual void IncreaseUnaryWeights (InputIteratorType begin, InputIteratorType end)
 
virtual void FinalizeMove ()
 
LabelType numOfLabels () const
 
virtual void UpdateMarginals ()
 
virtual IndexType getNextPWId () const
 

updates marginals in the current node so, that they correspond to the forward (backward) accumulated probabilities of labels

More...
 
virtual IndexType getPrevPWId () const
 

returns an external (_gm[.]) pairwise index, which follows the current variable. For the last variable this::NaN is returned

More...
 
MoveDirection getMoveDirection () const
 

returns an external (_gm[.]) pairwise index, which is in front of the current variable. For the first variable this::NaN is returned

More...
 
IndexType size () const
 
template<class ITERATOR >
ValueType evaluate (ITERATOR labeling)
 
void SetFastComputation (bool fc)
 

Protected Member Functions

void _Push ()
 
void _ExponentiatePWFactor ()
 
void _PushMessagesToVariable ()
 
void _PushAndAverage ()
 
void _UpdatePWAverage ()
 
ValueType _getMarginalsLogNormalizer () const
 
ValueType _GetAveragedUnaryFactors (ValueType &derivativeBound)
 

subtract it if you want to get normalized log-marginals from non-normalized ones

More...
 
void _makeLocalCopyOfPWFactor (LabelType trgsize)
 
void _InitCurrentUnaryBuffer (IndexType index)
 
- Protected Member Functions inherited from opengm::trws_base::DynamicProgramming< GM, ACC, InputIterator >
void _PottsUnaryTransform (LabelType newSize, const typename FactorProperties::ParameterStorageType &params)
 
void _InitReverseMoveBack ()
 
void _InitMove (ValueType rho, MoveDirection movedirection)
 >initializes move, which is reverse to the current one More...
 
void _core_InitMoves (ValueType rho, MoveDirection movedirection)
 
void _PushMessagesToFactor ()
 
void _ClearMessages (UnaryFactor *pbuffer=0)
 
void _SumUpBufferToMarginals ()
 
virtual void _BackUpForwardMarginals ()
 
IndexType _core_next (IndexType begin, MoveDirection dir) const
 
IndexType _next (IndexType begin) const
 
IndexType _previous (IndexType begin) const
 
IndexType _nextPWIndex () const
 

Protected Attributes

ValueType _mul
 
bool _averagingFlag
 
UnaryFactor _unaryBuffer
 
UnaryFactor _copyPWfactor
 
ValueType _derivativeValue
 
- Protected Attributes inherited from opengm::trws_base::DynamicProgramming< GM, ACC, InputIterator >
bool _fastComputation
 
Storage_storage
 
const FactorProperties_factorProperties
 
std::vector< UnaryFactor_marginals
 
ValueType _objectiveValue
 
ValueType _rho
 
MoveDirection _moveDirection
 
bool _bInitializationNeeded
 
UnaryFactor _currentPWFactor
 
UnaryFactor _currentUnaryFactor
 
IndexType _currentUnaryIndex
 
UnaryFactor _unaryTemp
 
Pseudo2DArray< ValueType_spst
 

Additional Inherited Members

- Static Public Attributes inherited from opengm::trws_base::DynamicProgramming< GM, ACC, InputIterator >
static const IndexType NaN =std::numeric_limits<IndexType>::max()
 

Detailed Description

template<class GM, class ACC, class InputIterator>
class opengm::trws_base::SumProdSolver< GM, ACC, InputIterator >

Definition at line 467 of file trws_subproblemsolver.hxx.

Member Typedef Documentation

template<class GM, class ACC, class InputIterator>
typedef parent::const_iterators_pair opengm::trws_base::SumProdSolver< GM, ACC, InputIterator >::const_iterators_pair

Definition at line 475 of file trws_subproblemsolver.hxx.

template<class GM, class ACC, class InputIterator>
typedef parent::FactorProperties opengm::trws_base::SumProdSolver< GM, ACC, InputIterator >::FactorProperties

Definition at line 479 of file trws_subproblemsolver.hxx.

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

Definition at line 472 of file trws_subproblemsolver.hxx.

template<class GM, class ACC, class InputIterator>
typedef parent::InputIteratorType opengm::trws_base::SumProdSolver< GM, ACC, InputIterator >::InputIteratorType

Definition at line 474 of file trws_subproblemsolver.hxx.

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

Definition at line 473 of file trws_subproblemsolver.hxx.

template<class GM, class ACC, class InputIterator>
typedef parent::MoveDirection opengm::trws_base::SumProdSolver< GM, ACC, InputIterator >::MoveDirection

Definition at line 477 of file trws_subproblemsolver.hxx.

template<class GM, class ACC, class InputIterator>
typedef DynamicProgramming<GM,ACC,InputIterator> opengm::trws_base::SumProdSolver< GM, ACC, InputIterator >::parent

Definition at line 470 of file trws_subproblemsolver.hxx.

template<class GM, class ACC, class InputIterator>
typedef parent::Storage opengm::trws_base::SumProdSolver< GM, ACC, InputIterator >::Storage

Definition at line 476 of file trws_subproblemsolver.hxx.

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

Definition at line 478 of file trws_subproblemsolver.hxx.

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

Definition at line 471 of file trws_subproblemsolver.hxx.

Constructor & Destructor Documentation

template<class GM, class ACC, class InputIterator>
opengm::trws_base::SumProdSolver< GM, ACC, InputIterator >::SumProdSolver ( Storage storage,
const FactorProperties factorProperties,
bool  fastComputations = true 
)
inline

Definition at line 482 of file trws_subproblemsolver.hxx.

Member Function Documentation

template<class GM , class ACC , class InputIterator >
void opengm::trws_base::SumProdSolver< GM, ACC, InputIterator >::_ExponentiatePWFactor ( )
protected

Definition at line 1277 of file trws_subproblemsolver.hxx.

+ Here is the call graph for this function:

template<class GM , class ACC , class InputIterator >
SumProdSolver< GM, ACC, InputIterator >::ValueType opengm::trws_base::SumProdSolver< GM, ACC, InputIterator >::_GetAveragedUnaryFactors ( ValueType derivativeBound)
protected

subtract it if you want to get normalized log-marginals from non-normalized ones

std::cout << "uf:"<<i <<", acc=" << acc <<", _unaryBuffer="<< _unaryBuffer;//BSD

Definition at line 1134 of file trws_subproblemsolver.hxx.

+ Here is the call graph for this function:

template<class GM, class ACC, class InputIterator>
ValueType opengm::trws_base::SumProdSolver< GM, ACC, InputIterator >::_getMarginalsLogNormalizer ( ) const
inlineprotected

Definition at line 496 of file trws_subproblemsolver.hxx.

template<class GM , class ACC , class InputIterator >
void opengm::trws_base::SumProdSolver< GM, ACC, InputIterator >::_InitCurrentUnaryBuffer ( IndexType  index)
protectedvirtual

Reimplemented from opengm::trws_base::DynamicProgramming< GM, ACC, InputIterator >.

Definition at line 1306 of file trws_subproblemsolver.hxx.

+ Here is the call graph for this function:

template<class GM , class ACC , class InputIterator >
void opengm::trws_base::SumProdSolver< GM, ACC, InputIterator >::_makeLocalCopyOfPWFactor ( LabelType  trgsize)
protectedvirtual
template<class GM , class ACC , class InputIterator >
void opengm::trws_base::SumProdSolver< GM, ACC, InputIterator >::_Push ( )
protectedvirtual
template<class GM , class ACC , class InputIterator >
void opengm::trws_base::SumProdSolver< GM, ACC, InputIterator >::_PushAndAverage ( )
protected

Definition at line 1109 of file trws_subproblemsolver.hxx.

template<class GM , class ACC , class InputIterator >
void opengm::trws_base::SumProdSolver< GM, ACC, InputIterator >::_PushMessagesToVariable ( )
protected

Definition at line 1000 of file trws_subproblemsolver.hxx.

template<class GM , class ACC , class InputIterator >
void opengm::trws_base::SumProdSolver< GM, ACC, InputIterator >::_UpdatePWAverage ( )
protected

Definition at line 1034 of file trws_subproblemsolver.hxx.

+ Here is the call graph for this function:

template<class GM , class ACC , class InputIterator >
SumProdSolver< GM, ACC, InputIterator >::ValueType opengm::trws_base::SumProdSolver< GM, ACC, InputIterator >::ComputeObjectiveValue ( )
virtual

Implements opengm::trws_base::DynamicProgramming< GM, ACC, InputIterator >.

Definition at line 1285 of file trws_subproblemsolver.hxx.

+ Here is the call graph for this function:

template<class GM, class ACC, class InputIterator>
ValueType opengm::trws_base::SumProdSolver< GM, ACC, InputIterator >::getDerivative ( ) const
inline

>makes MoveBack and returns derivative w.r.t. _smoothingValue

Definition at line 489 of file trws_subproblemsolver.hxx.

template<class GM, class ACC, class InputIterator>
void opengm::trws_base::SumProdSolver< GM, ACC, InputIterator >::InitMove ( ValueType  rho)
inline

Definition at line 484 of file trws_subproblemsolver.hxx.

template<class GM, class ACC, class InputIterator>
void opengm::trws_base::SumProdSolver< GM, ACC, InputIterator >::InitMove ( ValueType  rho,
MoveDirection  movedirection 
)
inline

Definition at line 485 of file trws_subproblemsolver.hxx.

template<class GM , class ACC , class InputIterator >
SumProdSolver< GM, ACC, InputIterator >::ValueType opengm::trws_base::SumProdSolver< GM, ACC, InputIterator >::MoveBackGetDerivative ( )

Definition at line 1218 of file trws_subproblemsolver.hxx.

Member Data Documentation

template<class GM, class ACC, class InputIterator>
bool opengm::trws_base::SumProdSolver< GM, ACC, InputIterator >::_averagingFlag
protected

Definition at line 502 of file trws_subproblemsolver.hxx.

template<class GM, class ACC, class InputIterator>
UnaryFactor opengm::trws_base::SumProdSolver< GM, ACC, InputIterator >::_copyPWfactor
protected

Definition at line 508 of file trws_subproblemsolver.hxx.

template<class GM, class ACC, class InputIterator>
ValueType opengm::trws_base::SumProdSolver< GM, ACC, InputIterator >::_derivativeValue
protected

Definition at line 509 of file trws_subproblemsolver.hxx.

template<class GM, class ACC, class InputIterator>
ValueType opengm::trws_base::SumProdSolver< GM, ACC, InputIterator >::_mul
protected

Definition at line 501 of file trws_subproblemsolver.hxx.

template<class GM, class ACC, class InputIterator>
UnaryFactor opengm::trws_base::SumProdSolver< GM, ACC, InputIterator >::_unaryBuffer
protected

Definition at line 507 of file trws_subproblemsolver.hxx.