OpenGM  2.3.x
Discrete Graphical Model Library
Public Types | Public Member Functions | Protected Attributes | List of all members
opengm::functions::learnable::LPotts< T, I, L > Class Template Reference

Learnable feature function for two variables. More...

#include <lpotts.hxx>

+ Inheritance diagram for opengm::functions::learnable::LPotts< T, I, L >:
+ Collaboration diagram for opengm::functions::learnable::LPotts< T, I, L >:

Public Types

typedef T ValueType
 
typedef L LabelType
 
typedef I IndexType
 
- Public Types inherited from opengm::FunctionBase< opengm::functions::learnable::LPotts< T, I, L >, T, I, L >
typedef AccessorIterator< FunctionShapeAccessorType, true > FunctionShapeIteratorType
 

Public Member Functions

 LPotts ()
 
 LPotts (const opengm::learning::Weights< T > &weights, const L numLabels, const std::vector< size_t > &weightIDs, const std::vector< T > &feat)
 
 LPotts (const L numLabels, const std::vector< size_t > &weightIDs, const std::vector< T > &feat)
 
shape (const size_t) const
 
size_t size () const
 
size_t dimension () const
 
template<class ITERATOR >
operator() (ITERATOR) const
 
void setWeights (const opengm::learning::Weights< T > &weights) const
 
size_t numberOfWeights () const
 
weightIndex (const size_t weightNumber) const
 
template<class ITERATOR >
weightGradient (size_t, ITERATOR) const
 
bool isPotts () const
 
bool isGeneralizedPotts () const
 
- Public Member Functions inherited from opengm::FunctionBase< opengm::functions::learnable::LPotts< T, I, L >, T, I, L >
bool isPotts () const
 
bool isGeneralizedPotts () const
 
bool isSubmodular () const
 
bool isSquaredDifference () const
 
bool isTruncatedSquaredDifference () const
 
bool isAbsoluteDifference () const
 
bool isTruncatedAbsoluteDifference () const
 
bool isLinearConstraint () const
 
MinMaxFunctor< T > minMax () const
 find minimum and maximum of the function in a single sweep More...
 
ReturnType min () const
 
ReturnType max () const
 
ReturnType sum () const
 
ReturnType product () const
 
ReturnType accumulate () const
 accumulate all values of the function More...
 
void forAllValuesInOrder (FUNCTOR &functor) const
 call a functor for each value of the function (in lexicographical order of the variable indices) More...
 
void forAllValuesInSwitchedOrder (FUNCTOR &functor) const
 
void forAllValuesInAnyOrder (FUNCTOR &functor) const
 call a functor for each value of the function (in un-specified order) More...
 
void forAtLeastAllUniqueValues (FUNCTOR &functor) const
 call a functor for at least all unique values of the function More...
 
void forAllValuesInOrderWithCoordinate (COORDINATE_FUNCTOR &functor) const
 
void forAllValuesInAnyOrderWithCoordinate (COORDINATE_FUNCTOR &functor) const
 
void forAtLeastAllUniqueValuesWithCoordinate (COORDINATE_FUNCTOR &functor) const
 
bool operator== (const opengm::functions::learnable::LPotts< T, I, L > &) const
 
FunctionShapeIteratorType functionShapeBegin () const
 
FunctionShapeIteratorType functionShapeEnd () const
 
size_t numberOfWeights () const
 
weightIndex (const size_t weightNumber) const
 
void setWeights (const opengm::learning::Weights< T > &) const
 
weightGradient (size_t, ITERATOR) const
 

Protected Attributes

const opengm::learning::Weights< T > * weights_
 
numLabels_
 
std::vector< size_tweightIDs_
 
std::vector< T > feat_
 

Detailed Description

template<class T, class I = size_t, class L = size_t>
class opengm::functions::learnable::LPotts< T, I, L >

Learnable feature function for two variables.

f(u,v) = ( w_i * feat_i) I(u!=v)

derive from this class and implement the function paramaterGradient(i,x)= A(x)_{i,*}*feat

Definition at line 29 of file lpotts.hxx.

Member Typedef Documentation

§ IndexType

template<class T, class I = size_t, class L = size_t>
typedef I opengm::functions::learnable::LPotts< T, I, L >::IndexType

Definition at line 35 of file lpotts.hxx.

§ LabelType

template<class T, class I = size_t, class L = size_t>
typedef L opengm::functions::learnable::LPotts< T, I, L >::LabelType

Definition at line 34 of file lpotts.hxx.

§ ValueType

template<class T, class I = size_t, class L = size_t>
typedef T opengm::functions::learnable::LPotts< T, I, L >::ValueType

Definition at line 33 of file lpotts.hxx.

Constructor & Destructor Documentation

§ LPotts() [1/3]

template<class T , class I , class L >
opengm::functions::learnable::LPotts< T, I, L >::LPotts ( )
inline

Definition at line 106 of file lpotts.hxx.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ LPotts() [2/3]

template<class T , class I , class L >
opengm::functions::learnable::LPotts< T, I, L >::LPotts ( const opengm::learning::Weights< T > &  weights,
const L  numLabels,
const std::vector< size_t > &  weightIDs,
const std::vector< T > &  feat 
)
inline

Definition at line 79 of file lpotts.hxx.

+ Here is the call graph for this function:

§ LPotts() [3/3]

template<class T , class I , class L >
opengm::functions::learnable::LPotts< T, I, L >::LPotts ( const L  numLabels,
const std::vector< size_t > &  weightIDs,
const std::vector< T > &  feat 
)
inline

Definition at line 93 of file lpotts.hxx.

+ Here is the call graph for this function:

Member Function Documentation

§ dimension()

template<class T , class I , class L >
size_t opengm::functions::learnable::LPotts< T, I, L >::dimension ( ) const
inline

Definition at line 153 of file lpotts.hxx.

§ isGeneralizedPotts()

template<class T, class I = size_t, class L = size_t>
bool opengm::functions::learnable::LPotts< T, I, L >::isGeneralizedPotts ( ) const
inline

Definition at line 63 of file lpotts.hxx.

§ isPotts()

template<class T, class I = size_t, class L = size_t>
bool opengm::functions::learnable::LPotts< T, I, L >::isPotts ( ) const
inline

Definition at line 62 of file lpotts.hxx.

§ numberOfWeights()

template<class T, class I = size_t, class L = size_t>
size_t opengm::functions::learnable::LPotts< T, I, L >::numberOfWeights ( ) const
inline

Definition at line 55 of file lpotts.hxx.

+ Here is the caller graph for this function:

§ operator()()

template<class T , class I , class L >
template<class ITERATOR >
T opengm::functions::learnable::LPotts< T, I, L >::operator() ( ITERATOR  begin) const
inline

Definition at line 131 of file lpotts.hxx.

+ Here is the call graph for this function:

§ setWeights()

template<class T, class I = size_t, class L = size_t>
void opengm::functions::learnable::LPotts< T, I, L >::setWeights ( const opengm::learning::Weights< T > &  weights) const
inline

Definition at line 53 of file lpotts.hxx.

§ shape()

template<class T , class I , class L >
L opengm::functions::learnable::LPotts< T, I, L >::shape ( const size_t  i) const
inline

Definition at line 145 of file lpotts.hxx.

+ Here is the caller graph for this function:

§ size()

template<class T , class I , class L >
size_t opengm::functions::learnable::LPotts< T, I, L >::size ( ) const
inline

Definition at line 159 of file lpotts.hxx.

§ weightGradient()

template<class T , class I , class L >
template<class ITERATOR >
T opengm::functions::learnable::LPotts< T, I, L >::weightGradient ( size_t  weightNumber,
ITERATOR  begin 
) const
inline

Definition at line 117 of file lpotts.hxx.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ weightIndex()

template<class T, class I = size_t, class L = size_t>
I opengm::functions::learnable::LPotts< T, I, L >::weightIndex ( const size_t  weightNumber) const
inline

Definition at line 57 of file lpotts.hxx.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

§ feat_

template<class T, class I = size_t, class L = size_t>
std::vector<T> opengm::functions::learnable::LPotts< T, I, L >::feat_
protected

Definition at line 69 of file lpotts.hxx.

§ numLabels_

template<class T, class I = size_t, class L = size_t>
L opengm::functions::learnable::LPotts< T, I, L >::numLabels_
protected

Definition at line 67 of file lpotts.hxx.

§ weightIDs_

template<class T, class I = size_t, class L = size_t>
std::vector<size_t> opengm::functions::learnable::LPotts< T, I, L >::weightIDs_
protected

Definition at line 68 of file lpotts.hxx.

§ weights_

template<class T, class I = size_t, class L = size_t>
const opengm::learning::Weights<T>* opengm::functions::learnable::LPotts< T, I, L >::weights_
mutableprotected

Definition at line 66 of file lpotts.hxx.