Feature Selection Toolbox FST4
UTIA · Czech Academy of Sciences
Loading...
Searching...
No Matches
FST::Sequential_Step_Straight_Threaded< RETURNTYPE, DIMTYPE, SUBSET, CRITERION > Class Template Reference

DEPRECATED shim: threaded version of sequential selection step in sequential search type of methods. More...

#include <seq_step_straight_threaded.hpp>

Inheritance diagram for FST::Sequential_Step_Straight_Threaded< RETURNTYPE, DIMTYPE, SUBSET, CRITERION >:
FST::Sequential_Step_Straight< RETURNTYPE, DIMTYPE, SUBSET, CRITERION > FST::Sequential_Step< RETURNTYPE, DIMTYPE, SUBSET, CRITERION >

Public Types

typedef Sequential_Step_Straight< RETURNTYPE, DIMTYPE, SUBSET, CRITERION > parent
 base class: the merged sequential-step implementation this shim configures with a threaded engine
typedef parent::PEvaluatorEngine PEvaluatorEngine
Public Types inherited from FST::Sequential_Step_Straight< RETURNTYPE, DIMTYPE, SUBSET, CRITERION >
typedef Sequential_Step< RETURNTYPE, DIMTYPE, SUBSET, CRITERION > parent
 base class alias
typedef std::shared_ptr< CRITERION > PCriterion
 shared pointer to the criterion the search optimizes
typedef std::shared_ptr< SUBSET > PSubset
 shared pointer to a feature subset
typedef Candidate_Evaluator< RETURNTYPE, DIMTYPE, SUBSET, CRITERION > EVALUATORENGINE
 the injected evaluation-strategy interface (sequential in-line or thread-pooled)
typedef std::shared_ptr< EVALUATORENGINE > PEvaluatorEngine
Public Types inherited from FST::Sequential_Step< RETURNTYPE, DIMTYPE, SUBSET, CRITERION >
typedef std::shared_ptr< CRITERION > PCriterion
 shared pointer to the criterion this step evaluates candidates against
typedef std::shared_ptr< SUBSET > PSubset
 shared pointer to a feature subset
typedef std::shared_ptr< Result_Tracker< RETURNTYPE, SUBSET > > PResultTracker
 shared pointer to the result tracker enabled via enable_result_tracking()

Public Member Functions

 Sequential_Step_Straight_Threaded (const unsigned int max_threads=2)
 Constructs a Sequential_Step_Straight configured with a Candidate_Evaluator_Threaded engine of max_threads workers.
Public Member Functions inherited from FST::Sequential_Step_Straight< RETURNTYPE, DIMTYPE, SUBSET, CRITERION >
 Sequential_Step_Straight (PEvaluatorEngine engine=PEvaluatorEngine())
 engine defaults to sequential in-line evaluation (Candidate_Evaluator_Sequential) if not supplied; pass a Candidate_Evaluator_Threaded to have the candidates evaluated in a thread pool
bool evaluate_candidates (RETURNTYPE &result, const PSubset sub, const PCriterion crit, const DIMTYPE _generalization_level=1, std::ostream &os=std::cout) override
 evaluates every subset offered by sub->get*CandidateSubset() and leaves the highest-valued one in sub (see Sequential_Step::evaluate_candidates() for the full contract)
virtual std::ostream & print (std::ostream &os) const override
 writes "Sequential_Step_Straight(threads=N)" if the injected engine is threaded, else "Sequential_Step_Straight()"
Public Member Functions inherited from FST::Sequential_Step< RETURNTYPE, DIMTYPE, SUBSET, CRITERION >
void enable_result_tracking (PResultTracker tracker)
 assigns a result tracker to this step, i.e., enables logging of all evaluated candidate subsets for future reuse (re-evaluation, etc.)
void disable_result_tracking ()
 detaches any result tracker (result_tracker_active() then returns false)
bool result_tracker_active () const
 true if a result tracker was assigned via enable_result_tracking() and not since disabled
void set_output_detail (OutputDetail detail)
 sets the amount of information that is logged to output stream throughout the course of search
OutputDetail get_output_detail () const
 the currently configured output detail level
bool output_normal () const
 true unless output detail is SILENT
bool output_detailed () const
 true only at the DETAILED output level

Additional Inherited Members

Protected Attributes inherited from FST::Sequential_Step_Straight< RETURNTYPE, DIMTYPE, SUBSET, CRITERION >
PEvaluatorEngine _engine
 injected evaluation strategy (sequential-inline or thread-pooled); defaulted in the constructor if not supplied
Protected Attributes inherited from FST::Sequential_Step< RETURNTYPE, DIMTYPE, SUBSET, CRITERION >
PResultTracker _tracker
 the assigned result tracker, or null (see enable_result_tracking()/result_tracker_active())
OutputDetail _detail
 the output detail level set via set_output_detail(); read by output_normal()/output_detailed()

Detailed Description

template<class RETURNTYPE, typename DIMTYPE, class SUBSET, class CRITERION>
class FST::Sequential_Step_Straight_Threaded< RETURNTYPE, DIMTYPE, SUBSET, CRITERION >

DEPRECATED shim: threaded version of sequential selection step in sequential search type of methods.

Deprecated
Deprecated since FST4 4.0; scheduled for removal in the next major release — construct the merged class with a Candidate_Evaluator_Threaded engine instead.

Kept for source compatibility with earlier FST4 sources, written when the threaded and the sequential variant were separate classes. This class is now nothing but a Sequential_Step_Straight constructed with a Candidate_Evaluator_Threaded engine; prefer doing that directly in new code.

Warning
Criterion clones can go stale. On its first use the threaded engine clones the criterion object passed to evaluate_candidates() once per worker thread, and it re-uses those clones for as long as the same criterion object is passed in. The clones are never re-synchronized with the original criterion, so a change of the original's context does not reach them. This matters above all with Criterion_Wrapper, whose state depends on the current data split: if the split changes and the clones do not, the workers keep evaluating on the wrong part of the data. Re-create the step object (and with it the engine and its clones) whenever the primary criterion's context changes - typically after every data split change. The same applies to Sequential_Step_Straight itself whenever it is constructed with a Candidate_Evaluator_Threaded engine; see the class documentation of Candidate_Evaluator_Threaded.

Member Typedef Documentation

◆ PEvaluatorEngine

template<class RETURNTYPE, typename DIMTYPE, class SUBSET, class CRITERION>
typedef parent::PEvaluatorEngine FST::Sequential_Step_Straight_Threaded< RETURNTYPE, DIMTYPE, SUBSET, CRITERION >::PEvaluatorEngine

the candidate-evaluation engine type, inherited from parent

Constructor & Destructor Documentation

◆ Sequential_Step_Straight_Threaded()

template<class RETURNTYPE, typename DIMTYPE, class SUBSET, class CRITERION>
FST::Sequential_Step_Straight_Threaded< RETURNTYPE, DIMTYPE, SUBSET, CRITERION >::Sequential_Step_Straight_Threaded ( const unsigned int max_threads = 2)
inlineexplicit

Constructs a Sequential_Step_Straight configured with a Candidate_Evaluator_Threaded engine of max_threads workers.

Parameters
max_threadspool capacity for the threaded engine (must be greater than zero, asserted)

The documentation for this class was generated from the following file:
Copyright © 2000–present ÚTIA, Institute of Information Theory and Automation of the Czech Academy of Sciences · Contacts · This site sets no cookies and uses no analytics.