Fleet  0.0.9
Inference in the LOT
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
BeamSearch< HYP > Class Template Reference

#include <BeamSearch.h>

Inheritance diagram for BeamSearch< HYP >:
Inheritance graph
[legend]
Collaboration diagram for BeamSearch< HYP >:
Collaboration graph
[legend]

Public Member Functions

 BeamSearch (HYP &h0, typename HYP::data_t *d, double temp)
 
void add (HYP &h)
 
void add (HYP &&h)
 
generator< HYP & > run_thread (Control &ctl) override
 
- Public Member Functions inherited from ThreadedInferenceInterface< HYP >
virtual generator< HYP &> run_thread (Control &ctl, Args... args)=0
 
 ThreadedInferenceInterface ()
 
unsigned long next_index ()
 Return the next index to operate on (in a thread-safe way). More...
 
size_t nthreads ()
 How many threads are currently run in this interface? More...
 
void run_thread_generator_wrapper (size_t thr, Control &ctl, Args... args)
 We have to wrap run_thread in something that manages the sync with main. This really just synchronizes the output of run_thread with run below. NOTE this makes a copy of x into the local next_x, so that when the thread keeps running, it doesn't mess anything up. We may in the future block the thread and return a reference, but its not clear that's faster. More...
 
generator< HYP &> run (Control ctl, Args... args)
 Set up the multiple threads and actually run, calling run_thread_generator_wrapper. More...
 
generator< HYP &> unthreaded_run (Control ctl, Args... args)
 

Public Attributes

TopN< HYP > Q
 
- Public Attributes inherited from ThreadedInferenceInterface< HYP >
std::atomic< size_t > index
 
size_t __nthreads
 
std::atomic< size_t > __nrunning
 
ConcurrentQueueRing< HYP > to_yield
 

Static Public Attributes

static constexpr size_t N = 1000000
 
static constexpr size_t N_REPS = 10
 
static constexpr double PARENT_PENALTY = 1.1
 
static double temperature = 100.0
 
static HYP::data_t * data = nullptr
 

Detailed Description

template<typename HYP>
class BeamSearch< HYP >

Author
piantado
Date
07/06/20

Constructor & Destructor Documentation

◆ BeamSearch()

template<typename HYP >
BeamSearch< HYP >::BeamSearch ( HYP &  h0,
typename HYP::data_t *  d,
double  temp 
)
inline

Member Function Documentation

◆ add() [1/2]

template<typename HYP >
void BeamSearch< HYP >::add ( HYP &  h)
inline

◆ add() [2/2]

template<typename HYP >
void BeamSearch< HYP >::add ( HYP &&  h)
inline

◆ run_thread()

template<typename HYP >
generator<HYP&> BeamSearch< HYP >::run_thread ( Control ctl)
inlineoverride

Member Data Documentation

◆ data

template<typename HYP >
HYP::data_t * BeamSearch< HYP >::data = nullptr
static

◆ N

template<typename HYP >
constexpr size_t BeamSearch< HYP >::N = 1000000
static

◆ N_REPS

template<typename HYP >
constexpr size_t BeamSearch< HYP >::N_REPS = 10
static

◆ PARENT_PENALTY

template<typename HYP >
constexpr double BeamSearch< HYP >::PARENT_PENALTY = 1.1
static

◆ Q

template<typename HYP >
TopN<HYP> BeamSearch< HYP >::Q

◆ temperature

template<typename HYP >
double BeamSearch< HYP >::temperature = 100.0
static

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