Alpha Expansion Library
C++ library for the Alpha-Expansion graph-cut algorithm with Python bindings
Loading...
Searching...
No Matches
Public Member Functions | List of all members
RandomizedStrategy< T > Class Template Reference

Expansion strategy that shuffles the label order randomly each cycle. More...

#include <RandomizedStrategy.hpp>

Inheritance diagram for RandomizedStrategy< T >:
[legend]
Collaboration diagram for RandomizedStrategy< T >:
[legend]

Public Member Functions

 RandomizedStrategy (int max_cycles=100, unsigned int seed=42)
 Constructs the strategy.
 
int execute (AlphaExpansion< T > &optimizer, EnergyModel< T > &model) const override
 Runs randomized alpha-expansion until convergence or max_cycles.
 
- Public Member Functions inherited from ExpansionStrategy< T >
virtual ~ExpansionStrategy ()=default
 

Detailed Description

template<typename T>
class RandomizedStrategy< T >

Expansion strategy that shuffles the label order randomly each cycle.

Works the same as SequentialStrategy, but the label order is randomly shuffled at the start of each cycle using a Mersenne Twister RNG. Good for studying how the label order affects convergence speed.

Template Parameters
TNumeric cost type.

Constructor & Destructor Documentation

◆ RandomizedStrategy()

template<typename T >
RandomizedStrategy< T >::RandomizedStrategy ( int  max_cycles = 100,
unsigned int  seed = 42 
)
inline

Constructs the strategy.

Parameters
max_cyclesMaximum number of cycles before stopping (default: 100).
seedSeed for the Mersenne Twister RNG (default: 42).

Member Function Documentation

◆ execute()

template<typename T >
int RandomizedStrategy< T >::execute ( AlphaExpansion< T > &  optimizer,
EnergyModel< T > &  model 
) const
inlineoverridevirtual

Runs randomized alpha-expansion until convergence or max_cycles.

Returns
Number of full cycles completed.

Implements ExpansionStrategy< T >.


The documentation for this class was generated from the following file: