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

Learnable weighted sum of feature-functions. More...

#include <lweightedsum_of_functions.hxx>

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

Public Types

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

Public Member Functions

 LWeightedSumOfFunctions ()
 
 LWeightedSumOfFunctions (const std::vector< L > &shape, const opengm::learning::Weights< T > &weights, const std::vector< size_t > &weightIDs, const std::vector< marray::Marray< 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
 
- Public Member Functions inherited from opengm::FunctionBase< opengm::functions::learnable::LWeightedSumOfFunctions< 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::LWeightedSumOfFunctions< 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_
 
std::vector< L > shape_
 
std::vector< size_tweightIDs_
 
std::vector< marray::Marray< T > > feat_
 

Detailed Description

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

Learnable weighted sum of feature-functions.

f(x) = w(i) * feat(i)(x)

Definition at line 28 of file lweightedsum_of_functions.hxx.

Member Typedef Documentation

§ IndexType

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

Definition at line 34 of file lweightedsum_of_functions.hxx.

§ LabelType

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

Definition at line 33 of file lweightedsum_of_functions.hxx.

§ ValueType

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

Definition at line 32 of file lweightedsum_of_functions.hxx.

Constructor & Destructor Documentation

§ LWeightedSumOfFunctions() [1/2]

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

Definition at line 89 of file lweightedsum_of_functions.hxx.

+ Here is the call graph for this function:

§ LWeightedSumOfFunctions() [2/2]

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

Definition at line 71 of file lweightedsum_of_functions.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::LWeightedSumOfFunctions< T, I, L >::dimension ( ) const
inline

Definition at line 134 of file lweightedsum_of_functions.hxx.

+ Here is the caller graph for this function:

§ numberOfWeights()

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

Definition at line 51 of file lweightedsum_of_functions.hxx.

+ Here is the caller graph for this function:

§ operator()()

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

Definition at line 112 of file lweightedsum_of_functions.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::LWeightedSumOfFunctions< T, I, L >::setWeights ( const opengm::learning::Weights< T > &  weights) const
inline

Definition at line 49 of file lweightedsum_of_functions.hxx.

§ shape()

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

Definition at line 126 of file lweightedsum_of_functions.hxx.

+ Here is the caller graph for this function:

§ size()

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

Definition at line 140 of file lweightedsum_of_functions.hxx.

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

§ weightGradient()

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

Definition at line 100 of file lweightedsum_of_functions.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::LWeightedSumOfFunctions< T, I, L >::weightIndex ( const size_t  weightNumber) const
inline

Definition at line 53 of file lweightedsum_of_functions.hxx.

+ Here is the call graph for this function:

Member Data Documentation

§ feat_

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

Definition at line 62 of file lweightedsum_of_functions.hxx.

§ shape_

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

Definition at line 60 of file lweightedsum_of_functions.hxx.

§ weightIDs_

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

Definition at line 61 of file lweightedsum_of_functions.hxx.

§ weights_

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

Definition at line 59 of file lweightedsum_of_functions.hxx.