AutoPas  3.0.0
Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
autopas::PredictiveTuning Class Referencefinal

In every tuning phase, this strategy makes a prediction about the run time for every configuration. More...

#include <PredictiveTuning.h>

Inheritance diagram for autopas::PredictiveTuning:
Inheritance graph
[legend]
Collaboration diagram for autopas::PredictiveTuning:
Collaboration graph
[legend]

Public Types

using PredictionsType = std::unordered_map< Configuration, long, ConfigHash >
 Shorthand for the type used to store predictions in.
 

Public Member Functions

 PredictiveTuning (double relativeOptimum, unsigned int maxTuningIterationsWithoutTest, unsigned int testsUntilFirstPrediction, ExtrapolationMethodOption extrapolationMethodOption, const std::string &outputSuffix="")
 Constructor for the PredictiveTuning that generates the search space from the allowed options.
 
TuningStrategyOption getOptionType () const override
 Get this object's associated TuningStrategyOption type.
 
void addEvidence (const Configuration &configuration, const Evidence &evidence) override
 Notifies the strategy about empirically collected information for the given configuration.
 
bool reset (size_t iteration, size_t tuningPhase, std::vector< Configuration > &configQueue, const autopas::EvidenceCollection &evidenceCollection) override
 Reset all internal parameters to the beginning of a new tuning phase.
 
bool optimizeSuggestions (std::vector< Configuration > &configQueue, const EvidenceCollection &evidenceCollection) override
 Optimizes the queue of configurations to process.
 
void rejectConfiguration (const Configuration &configuration, bool indefinitely) override
 Notify the strategy about a configuration that is (currently) invalid and thus can potentially be dropped from some internal storage.
 
PredictiveTuning::PredictionsType calculatePredictions (size_t iteration, size_t tuningPhase, const std::vector< Configuration > &configurations, const autopas::EvidenceCollection &evidenceCollection)
 For all given configuration use the chosen extrapolation method to calculate a prediction based on the given evidence.
 
- Public Member Functions inherited from autopas::TuningStrategyInterface
virtual TuningStrategyOption getOptionType () const =0
 Get this object's associated TuningStrategyOption type.
 
virtual void addEvidence (const Configuration &configuration, const Evidence &evidence)
 Notifies the strategy about empirically collected information for the given configuration.
 
virtual bool optimizeSuggestions (std::vector< Configuration > &configQueue, const EvidenceCollection &evidenceCollection)=0
 Optimizes the queue of configurations to process.
 
virtual bool reset (size_t iteration, size_t tuningPhase, std::vector< Configuration > &configQueue, const autopas::EvidenceCollection &evidenceCollection)=0
 Reset all internal parameters to the beginning of a new tuning phase.
 
virtual bool needsLiveInfo () const
 Returns whether this tuning strategy wants to get a LiveInfo object passed before a new tuning phase.
 
virtual void receiveLiveInfo (const LiveInfo &info)
 Virtual method that subclasses can override to receive the LiveInfo object before a tuning phase if they return true in needsLiveInfo().
 
virtual void rejectConfiguration (const Configuration &configuration, bool indefinitely)
 Notify the strategy about a configuration that is (currently) invalid and thus can potentially be dropped from some internal storage.
 
virtual bool needsSmoothedHomogeneityAndMaxDensity () const
 Indicate whether the strategy needs smoothed values of homogeneity and max density.
 
virtual void receiveSmoothedHomogeneityAndMaxDensity (double homogeneity, double maxDensity)
 Method to pass smoothed homogeneity and the maximal density to the tuning strategy.
 

Detailed Description

In every tuning phase, this strategy makes a prediction about the run time for every configuration.

Then only those are tested which have the best predictions. In the end, the configuration that performed best during testing is selected.

Predictions about run time are extrapolations from previous measurements. There are multiple extrapolation methods available. Depending on this choice a certain number of tuning phases is necessary where everything is tested.

Additional features:

The strategy works by having multiple sets of configurations (e.g. the whole search space, optimal search space, search space of configurations that were not tested for a long time). _currentConfig is a iterator to any of them and might be switched between the sets depending on what is currently tested.

Member Typedef Documentation

◆ PredictionsType

Shorthand for the type used to store predictions in.

Map < Configuration, PredictionValue >

Constructor & Destructor Documentation

◆ PredictiveTuning()

autopas::PredictiveTuning::PredictiveTuning ( double  relativeOptimum,
unsigned int  maxTuningIterationsWithoutTest,
unsigned int  testsUntilFirstPrediction,
ExtrapolationMethodOption  extrapolationMethodOption,
const std::string &  outputSuffix = "" 
)

Constructor for the PredictiveTuning that generates the search space from the allowed options.

Parameters
relativeOptimum
maxTuningIterationsWithoutTest
testsUntilFirstPrediction
extrapolationMethodOption
outputSuffix

Member Function Documentation

◆ addEvidence()

void autopas::PredictiveTuning::addEvidence ( const Configuration configuration,
const Evidence evidence 
)
overridevirtual

Notifies the strategy about empirically collected information for the given configuration.

All evidence is stored centrally in the AutoTuner and its EvidenceCollection is passed to the tuning strategies during optimization.

Implementing this function is only necessary if the tuning strategy processes evidence differently than EvidenceCollection.

Parameters
configurationConfiguration used to obtain the evidence.
evidenceMeasurement and when it was taken.

Reimplemented from autopas::TuningStrategyInterface.

◆ calculatePredictions()

PredictiveTuning::PredictionsType autopas::PredictiveTuning::calculatePredictions ( size_t  iteration,
size_t  tuningPhase,
const std::vector< Configuration > &  configurations,
const autopas::EvidenceCollection evidenceCollection 
)

For all given configuration use the chosen extrapolation method to calculate a prediction based on the given evidence.

Parameters
iterationThe iteration for which to calculate the predictions.
tuningPhaseThe current tuning phase number.
configurationsConfigurations for which to calculate predictions.
evidenceCollectionData on which all extrapolation is based on.
Returns
For each configuration a predictions.

◆ getOptionType()

TuningStrategyOption autopas::PredictiveTuning::getOptionType ( ) const
overridevirtual

Get this object's associated TuningStrategyOption type.

Returns
TuningStrategyOption

Implements autopas::TuningStrategyInterface.

◆ optimizeSuggestions()

bool autopas::PredictiveTuning::optimizeSuggestions ( std::vector< Configuration > &  configQueue,
const EvidenceCollection evidenceCollection 
)
overridevirtual

Optimizes the queue of configurations to process.

This function is called once before each iteration in a tuning phase so all tuning strategies can give their input on which configuration to try next. This is done by reordering configQueue so that the next configuration to try is at the end (FIFO).

Parameters
configQueueQueue of configurations to be tested. The tuning strategy should edit this queue.
evidenceCollectionAll collected evidence until now.
Returns
boolean value to signal if the tuning strategy has intentionally wiped the config queue

Implements autopas::TuningStrategyInterface.

◆ rejectConfiguration()

void autopas::PredictiveTuning::rejectConfiguration ( const Configuration configuration,
bool  indefinitely 
)
overridevirtual

Notify the strategy about a configuration that is (currently) invalid and thus can potentially be dropped from some internal storage.

Parameters
configuration
indefinitelyWhether the given configuration will never be valid

Reimplemented from autopas::TuningStrategyInterface.

◆ reset()

bool autopas::PredictiveTuning::reset ( size_t  iteration,
size_t  tuningPhase,
std::vector< Configuration > &  configQueue,
const autopas::EvidenceCollection evidenceCollection 
)
overridevirtual

Reset all internal parameters to the beginning of a new tuning phase.

This can also mean to reorder the configQueue to some initially expected state.

Parameters
iterationGives the current iteration to the tuning strategy.
tuningPhaseGives the current tuning phase to the tuning strategy.
configQueueQueue of configurations to be tested. The tuning strategy should edit this queue.
evidenceCollectionAll collected evidence until now.
Returns
boolean value to signal if the tuning strategy has intentionally wiped the config queue

Implements autopas::TuningStrategyInterface.


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