qxmt.models.builder module#
- class qxmt.models.builder.ModelBuilder(config, n_jobs=2)
Bases:
object
Builder class for quantum machine learning models. This class is responsible for building quantum machine learning models. Absorb differences among various platforms, Feature Maps, and Kernels, and build models that can be handled as a common interface within the library.
Examples
>>> from qxmt.configs import ExperimentConfig >>> from qxmt.models.builder import ModelBuilder >>> config = ExperimentConfig(path="configs/my_run.yaml") >>> model = ModelBuilder(config).build()
- Parameters:
config (ExperimentConfig)
n_jobs (int)
- __init__(config, n_jobs=2)
Initialize the model builder.
- Parameters:
config (ExperimentConfig) – Configuration for the experiment.
n_jobs (int) – number of jobs for parallel computation
- Return type:
None
- build()
- Build quantum model by following steps:
Set quantum device
Set quantum feature map
Set quantum kernel
Set quantum model
- Return type:
BaseMLModel