Class ConcreteExperiment

Inheritance Relationships

Base Type

Class Documentation

class sparsebase::experiment::ConcreteExperiment : public sparsebase::experiment::ExperimentType

Public Functions

virtual void Run(unsigned int times = 1, bool store_auxiliary = false) override

Start the experiment. Each target will be preprocessed by all the preprocessing functions. Then every kernel will be applied to all of the newly created data. The cartesian product of the number of _targets, _preprocesses and _kernels iterations will be carried out.

Parameters
  • times – Specifies the number of samples.

  • store_auxiliary – determines if the auxiliary data created as a by product of the experiments is going to be stored or not.

virtual void AddDataLoader(LoadDataFunction func, std::vector<std::pair<std::vector<std::string>, std::any>> targets) override

Adds a dataLoader to the experiment. Each target data needs to be loaded to experiment via a LoadDataFunction.

Parameters
  • func – The function which follows the LoadDataFunction definition.

  • targets – File paths and file specific parameters.

virtual void AddPreprocess(std::string id, PreprocessFunction func, std::any params) override

Adds a preprocessing to the experiment. Each preprocessing operation is added to experiment via a PreprocessFunction.

Parameters
  • id – Preprocessing id, used to store results, runtimes and auxiliary data.

  • func – The function which follows the PreprocessFunction definition.

virtual void AddKernel(std::string id, KernelFunction func, std::any params) override

Adds a kernel to the experiment. Each kernel is added to experiment via a KernelFunction.

Parameters
  • id – Kernel ID is used to store results, runtimes and auxiliary data.

  • func – The function which follows the KernelFunction definition.

virtual std::map<std::string, std::vector<double>> GetRunTimes() override
Returns

Returns the runtimes of each kernel call.

virtual std::map<std::string, std::vector<std::any>> GetResults() override
Returns

Returns the results of each kernel call.

virtual std::map<std::string, std::any> GetAuxiliary() override
Returns

Returns the auxiliary data stored during the experiment.

Protected Attributes

std::vector<std::vector<std::pair<std::vector<std::string>, std::any>>> targets_

Stores the file_paths of the files to be extracted, along with the file specific parameters attached.

std::unordered_map<std::string, std::pair<KernelFunction, std::any>> kernels_

Stores the kernel functions that are going to be run.

std::vector<LoadDataFunction> dataLoaders_

Stores dataLoaders.

std::unordered_map<std::string, std::pair<PreprocessFunction, std::any>> preprocesses_

Stores preprocesses.

std::map<std::string, std::any> auxiliary_

Stores auxiliary data.

std::map<std::string, std::vector<double>> runtimes_

Stores runtimes. The identifier is generated as a comma delimited string of target,preprocess_id, and kernel_id respectively.

std::map<std::string, std::vector<std::any>> results_

Stores results generated by the kernels. The identifier is generated as a comma delimited string of target,preprocess_id, and kernel_id respectively.