modules.applications.qml.data_handler.DataHandler
- class DataHandler
Bases:
ABCAbstract base class for DataHandler. This class defines the necessary methods that both supervised and unsupervised QML applciations must implement.
- __init__()
Methods
__init__()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.
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
- 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