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

GREEDY GREMLIN. More...

#include <greedygremlin.hxx>

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

Classes

struct  Parameter
 

Public Types

typedef GM GraphicalModelType
 graphical model type More...
 
typedef ACC AccumulationType
 accumulation type More...
 
typedef visitors::VerboseVisitor< GreedyGremlin< GM, ACC > > VerboseVisitorType
 visitor More...
 
typedef visitors::EmptyVisitor< GreedyGremlin< GM, ACC > > EmptyVisitorType
 
typedef visitors::TimingVisitor< GreedyGremlin< GM, ACC > > TimingVisitorType
 
- Public Types inherited from opengm::Inference< GM, ACC >
typedef GM GraphicalModelType
 
typedef ACC AccumulationType
 
typedef GraphicalModelType::LabelType LabelType
 
typedef GraphicalModelType::IndexType IndexType
 
typedef GraphicalModelType::ValueType ValueType
 
typedef GraphicalModelType::OperatorType OperatorType
 
typedef GraphicalModelType::FactorType FactorType
 
typedef GraphicalModelType::IndependentFactorType IndependentFactorType
 
typedef GraphicalModelType::FunctionIdentifier FunctionIdentifier
 

Public Member Functions

 GreedyGremlin (const GM &gm, Parameter para=Parameter())
 constructor More...
 
virtual std::string name () const
 
const GraphicalModelTypegraphicalModel () const
 
virtual InferenceTermination infer ()
 
virtual void reset ()
 reset More...
 
template<class VisitorType >
InferenceTermination infer (VisitorType &vistitor)
 inference with visitor More...
 
virtual InferenceTermination marginal (const size_t, IndependentFactorType &out) const
 output a solution for a marginal for a specific variable More...
 
virtual InferenceTermination factorMarginal (const size_t, IndependentFactorType &out) const
 output a solution for a marginal for all variables connected to a factor More...
 
virtual InferenceTermination arg (std::vector< LabelType > &v, const size_t=1) const
 output a solution More...
 
virtual InferenceTermination args (std::vector< std::vector< LabelType > > &v) const
 args More...
 
- Public Member Functions inherited from opengm::Inference< GM, ACC >
virtual ~Inference ()
 
virtual void setStartingPoint (typename std::vector< LabelType >::const_iterator)
 set initial labeling More...
 
virtual ValueType bound () const
 return a bound on the solution More...
 
virtual ValueType value () const
 return the solution (value) More...
 
InferenceTermination constrainedOptimum (std::vector< IndexType > &, std::vector< LabelType > &, std::vector< LabelType > &) const
 
InferenceTermination modeFromMarginal (std::vector< LabelType > &) const
 
InferenceTermination modeFromFactorMarginal (std::vector< LabelType > &) const
 

Public Attributes

 OPENGM_GM_TYPE_TYPEDEFS
 

Detailed Description

template<class GM, class ACC>
class opengm::GreedyGremlin< GM, ACC >

GREEDY GREMLIN.

The greedy gremlin is a simple greedy algorithm for inference on graphical models. It itteratively fix a variable that is the best given all so far fixed variables, by ingoring all factors that include variables that are not fixed so far (exclude the current variable)

The greedy gremlin defines a baseline for other algorithms.

Definition at line 34 of file greedygremlin.hxx.

Member Typedef Documentation

template<class GM, class ACC>
typedef ACC opengm::GreedyGremlin< GM, ACC >::AccumulationType

accumulation type

Definition at line 40 of file greedygremlin.hxx.

template<class GM, class ACC>
typedef visitors::EmptyVisitor<GreedyGremlin<GM, ACC> > opengm::GreedyGremlin< GM, ACC >::EmptyVisitorType

Definition at line 44 of file greedygremlin.hxx.

template<class GM, class ACC>
typedef GM opengm::GreedyGremlin< GM, ACC >::GraphicalModelType

graphical model type

Definition at line 38 of file greedygremlin.hxx.

template<class GM, class ACC>
typedef visitors::TimingVisitor<GreedyGremlin<GM, ACC> > opengm::GreedyGremlin< GM, ACC >::TimingVisitorType

Definition at line 45 of file greedygremlin.hxx.

template<class GM, class ACC>
typedef visitors::VerboseVisitor<GreedyGremlin<GM, ACC> > opengm::GreedyGremlin< GM, ACC >::VerboseVisitorType

visitor

Definition at line 43 of file greedygremlin.hxx.

Constructor & Destructor Documentation

template<class GM , class ACC >
opengm::GreedyGremlin< GM, ACC >::GreedyGremlin ( const GM &  gm,
Parameter  para = Parameter() 
)

constructor

Parameters
gmgraphical model
paraGreedyGremlin parameter

Definition at line 77 of file greedygremlin.hxx.

Member Function Documentation

template<class GM , class ACC >
InferenceTermination opengm::GreedyGremlin< GM, ACC >::arg ( std::vector< LabelType > &  arg,
const size_t  argIndex = 1 
) const
virtual

output a solution

Parameters
[out]arglabeling
argIndexsolution index (1=best, 2=second best, etc.)

Reimplemented from opengm::Inference< GM, ACC >.

Definition at line 175 of file greedygremlin.hxx.

template<class GM, class ACC>
InferenceTermination opengm::GreedyGremlin< GM, ACC >::args ( std::vector< std::vector< LabelType > > &  v) const
virtual

args

Parameters
[out]

Reimplemented from opengm::Inference< GM, ACC >.

Definition at line 192 of file greedygremlin.hxx.

template<class GM, class ACC>
virtual InferenceTermination opengm::GreedyGremlin< GM, ACC >::factorMarginal ( const size_t  factorIndex,
IndependentFactorType out 
) const
inlinevirtual

output a solution for a marginal for all variables connected to a factor

Parameters
factorIndexindex of the factor
[out]outthe marginal

Reimplemented from opengm::Inference< GM, ACC >.

Definition at line 57 of file greedygremlin.hxx.

template<class GM , class ACC >
const GreedyGremlin< GM, ACC >::GraphicalModelType & opengm::GreedyGremlin< GM, ACC >::graphicalModel ( ) const
inlinevirtual

Implements opengm::Inference< GM, ACC >.

Definition at line 200 of file greedygremlin.hxx.

template<class GM , class ACC >
InferenceTermination opengm::GreedyGremlin< GM, ACC >::infer ( )
virtual

Implements opengm::Inference< GM, ACC >.

Definition at line 100 of file greedygremlin.hxx.

template<class GM , class ACC >
template<class VisitorType >
InferenceTermination opengm::GreedyGremlin< GM, ACC >::infer ( VisitorType &  visitor)

inference with visitor

Parameters
visitorvisitor

Definition at line 110 of file greedygremlin.hxx.

template<class GM, class ACC>
virtual InferenceTermination opengm::GreedyGremlin< GM, ACC >::marginal ( const size_t  variableIndex,
IndependentFactorType out 
) const
inlinevirtual

output a solution for a marginal for a specific variable

Parameters
variableIndexindex of the variable
[out]outthe marginal

Reimplemented from opengm::Inference< GM, ACC >.

Definition at line 56 of file greedygremlin.hxx.

template<class GM, class ACC>
virtual std::string opengm::GreedyGremlin< GM, ACC >::name ( ) const
inlinevirtual

Implements opengm::Inference< GM, ACC >.

Definition at line 51 of file greedygremlin.hxx.

template<class GM , class ACC >
void opengm::GreedyGremlin< GM, ACC >::reset ( )
virtual

reset

Warning
reset assumes that the structure of the graphical model has not changed

TODO

todo

Definition at line 93 of file greedygremlin.hxx.

Member Data Documentation

template<class GM, class ACC>
opengm::GreedyGremlin< GM, ACC >::OPENGM_GM_TYPE_TYPEDEFS

Definition at line 41 of file greedygremlin.hxx.