modules.applications.qml.generative_modeling.data.data_handler.data_handler_generative.DataHandlerGenerative
- class DataHandlerGenerative(name: str)
Bases:
Core,DataHandler,ABCThe task of the DataHandler module is to translate the application’s data and problem specification into preprocessed format.
- __init__(name: str)
Constructor method.
Methods
__init__(name)Constructor method.
data_load(gen_mod, config)Helps to ensure that the model can effectively learn the underlying patterns and structure of the data, and produce high-quality outputs.
evaluate(solution)Computes the best loss values.
Computes generalization metrics.
Gets the list of available options.
get_available_submodules(option)If the module has submodules depending on certain options, this method should adjust the submodule_options accordingly.
get_default_submodule(option)Given an option string by the user, this returns a submodule.
get_depending_parameters(option, config)If the module has parameters depending on certain options, this method should return the parameters for the given option.
Returns the parameters for a given module.
Returns requirements of this module.
get_submodule(option)Submodule is instantiated according to the information given in self.sub_options.
postprocess(input_data, config, **kwargs)In this module, the postprocessing step is transforming the data to the correct target format.
preprocess(input_data, config, **kwargs)In this module, the preprocessing step is transforming the data to the correct target format.
tb_to_pd(logdir, rep)Converts TensorBoard event files in the specified log directory into a pandas DataFrame and saves it as a pickle file.
- abstract data_load(gen_mod: dict, config: dict) tuple[any, float]
Helps to ensure that the model can effectively learn the underlying patterns and structure of the data, and produce high-quality outputs.
- Parameters:
gen_mod -- Dictionary with collected information of the previous modules
config -- Config specifying the parameters of the data handler
- Returns:
Mapped problem and the time it took to create the mapping
- abstract evaluate(solution: any) tuple[any, float]
Computes the best loss values.
- Parameters:
solution -- Solution data
- Returns:
Evaluation data and the time it took to create it
- generalization() tuple[dict, float]
Computes generalization metrics.
- Returns:
Evaluation and the time it took to create it
- get_available_submodule_options() list
Gets the list of available options.
- Returns:
List of module options
- get_available_submodules(option: list) list
If the module has submodules depending on certain options, this method should adjust the submodule_options accordingly.
- Parameters:
option -- List of chosen options
- Returns:
List of available submodules
- abstract get_default_submodule(option: str) Core
Given an option string by the user, this returns a submodule.
- Parameters:
option -- String with the chosen submodule
- Returns:
Module of type Core
- get_depending_parameters(option: str, config: dict) dict
If the module has parameters depending on certain options, this method should return the parameters for the given option.
- Parameters:
option -- The chosen option
config -- Current config dictionary
- Returns:
The parameters for the given option
- abstract get_parameter_options() dict
Returns the parameters for a given module.
Should always be in this format:
{ "parameter_name":{ "values":[1, 2, 3], "description":"How many nodes do you need?" }, "parameter_name_2":{ "values":["x", "y"], "description":"Which type of problem do you want?" } }
- Returns:
Available settings for this application
- static get_requirements() list[dict]
Returns requirements of this module.
- Returns:
List of dict with requirements of this module
- get_submodule(option: str) Core
Submodule is instantiated according to the information given in self.sub_options. If self.sub_options is None, get_default_submodule is called as a fallback.
- Parameters:
option -- String with the options
- Returns:
Instance of a module
- postprocess(input_data: dict, config: dict, **kwargs) tuple[dict, float]
In this module, the postprocessing step is transforming the data to the correct target format.
- Parameters:
input_data -- Original data
config -- Config specifying the parameters of the training
kwargs -- Optional additional settings
- Returns:
Tuple with an output_dictionary and the time it took
- preprocess(input_data: dict, config: dict, **kwargs) tuple[any, float]
In this module, the preprocessing step is transforming the data to the correct target format.
- Parameters:
input_data -- Collected information of the benchmarking process
config -- Config specifying the parameters of the training
kwargs -- Optional additional settings
- Returns:
Tuple with transformed problem and the time it took to map it
- static tb_to_pd(logdir: str, rep: str) None
Converts TensorBoard event files in the specified log directory into a pandas DataFrame and saves it as a pickle file.
- Parameters:
logdir -- Path to the log directory containing TensorBoard event files
rep -- Repetition counter