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

UnaryLossFunction convert semi-ring in a lazy fashion. More...

#include <unary_loss_function.hxx>

+ Inheritance diagram for opengm::UnaryLossFunction< T, I, L >:
+ Collaboration diagram for opengm::UnaryLossFunction< T, I, L >:

Classes

struct  SharedMultiplers
 

Public Types

enum  LossType {
  HammingLoss = 0, LabelVectorConf = 1, LabelVectorGt = 2, LabelMatrix = 3,
  L1Loss = 4, L2Loss = 5
}
 
typedef T ValueType
 
typedef T value_type
 
typedef I IndexType
 
typedef L LabelType
 
- Public Types inherited from opengm::FunctionBase< UnaryLossFunction< T, I, L >, T, I, L >
typedef AccessorIterator< FunctionShapeAccessorType, true > FunctionShapeIteratorType
 

Public Member Functions

 UnaryLossFunction (const LabelType numberOfLabels, const LabelType gtLabel, const LossType lossType, const ValueType multiplier, const SharedMultiplers &sharedMultiplers, const bool owner)
 
template<class Iterator >
ValueType operator() (Iterator begin) const
 
IndexType shape (const IndexType) const
 
IndexType dimension () const
 
IndexType size () const
 
- Public Member Functions inherited from opengm::FunctionBase< UnaryLossFunction< 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 UnaryLossFunction< 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
 

Detailed Description

template<class T, class I, class L>
class opengm::UnaryLossFunction< T, I, L >

UnaryLossFunction convert semi-ring in a lazy fashion.

Definition at line 23 of file unary_loss_function.hxx.

Member Typedef Documentation

§ IndexType

template<class T, class I, class L>
typedef I opengm::UnaryLossFunction< T, I, L >::IndexType

Definition at line 30 of file unary_loss_function.hxx.

§ LabelType

template<class T, class I, class L>
typedef L opengm::UnaryLossFunction< T, I, L >::LabelType

Definition at line 31 of file unary_loss_function.hxx.

§ value_type

template<class T, class I, class L>
typedef T opengm::UnaryLossFunction< T, I, L >::value_type

Definition at line 29 of file unary_loss_function.hxx.

§ ValueType

template<class T, class I, class L>
typedef T opengm::UnaryLossFunction< T, I, L >::ValueType

Definition at line 28 of file unary_loss_function.hxx.

Member Enumeration Documentation

§ LossType

template<class T, class I, class L>
enum opengm::UnaryLossFunction::LossType
Enumerator
HammingLoss 
LabelVectorConf 
LabelVectorGt 
LabelMatrix 
L1Loss 
L2Loss 

Definition at line 34 of file unary_loss_function.hxx.

Constructor & Destructor Documentation

§ UnaryLossFunction()

template<class T , class I , class L >
opengm::UnaryLossFunction< T, I, L >::UnaryLossFunction ( const LabelType  numberOfLabels,
const LabelType  gtLabel,
const LossType  lossType,
const ValueType  multiplier,
const SharedMultiplers sharedMultiplers,
const bool  owner 
)
inline

Definition at line 74 of file unary_loss_function.hxx.

Member Function Documentation

§ dimension()

template<class T , class I , class L >
UnaryLossFunction< T, I, L >::IndexType opengm::UnaryLossFunction< T, I, L >::dimension ( ) const
inline

Definition at line 139 of file unary_loss_function.hxx.

§ operator()()

template<class T , class I , class L >
template<class Iterator >
UnaryLossFunction< T, I, L >::ValueType opengm::UnaryLossFunction< T, I, L >::operator() ( Iterator  begin) const
inline

Definition at line 96 of file unary_loss_function.hxx.

+ Here is the call graph for this function:

§ shape()

template<class T, class I, class L>
UnaryLossFunction< T, I, L >::IndexType opengm::UnaryLossFunction< T, I, L >::shape ( const IndexType  ) const
inline

Definition at line 131 of file unary_loss_function.hxx.

+ Here is the caller graph for this function:

§ size()

template<class T , class I , class L >
UnaryLossFunction< T, I, L >::IndexType opengm::UnaryLossFunction< T, I, L >::size ( ) const
inline

Definition at line 145 of file unary_loss_function.hxx.