API Reference¶
Breaking Changes in v0.2
Recent upgrade to version >= v0.2.0 may cause some breaking changes. Make some documented instructions may be outdated.
You can install a specific version by pip install fusion-bench==0.1.6
or checkout to a specific version by git checkout v0.1.6
.
If you encounter any issues, please feel free to raise an issue.
We are working on the documentation and will update it as soon as possible.
Use version >=0.2.0 is recommended.
Here we provides an overview of the API reference for FusionBench.
Entry Points¶
main(cfg)
¶
Main entry point for the FusionBench command-line interface.
This function serves as the primary entry point for the fusion_bench
CLI command.
It is decorated with Hydra's main decorator to handle configuration management,
command-line argument parsing, and configuration file loading.
The function performs the following operations: 1. Resolves any interpolations in the configuration using OmegaConf 2. Instantiates the appropriate program class based on the configuration 3. Executes the program's run method to perform the fusion task
Parameters:
-
cfg
(DictConfig
) –The Hydra configuration object containing all settings for the fusion task. This includes method configuration, model pool configuration, task pool configuration, and other runtime parameters. The configuration is automatically loaded by Hydra from the specified config files and command-line overrides.
Returns:
-
None
(None
) –This function doesn't return a value but executes the fusion program which may save results, log outputs, or perform other side effects as configured.
Example
This function is typically called automatically when running:
The Hydra decorator handles parsing these command-line arguments and loading the corresponding configuration files to populate the cfg parameter.
Source code in fusion_bench/scripts/cli.py
Class Definitions¶
Base class for all FusionBench components.
- fusion_bench.BaseAlgorithm: Base class for all algorithms.
- fusion_bench.BaseModelPool: Base class for all model pools.
- fusion_bench.BaseTaskPool: Base class for all task pools.
Modules¶
- fusion_bench.mixins: Mixins.
- fusion_bench.program: Program definitions.
- fusion_bench.method: Implementation of methods.
- fusion_bench.modelpool: Model pools.
- fusion_bench.taskpool: Task pools.
- fusion_bench.utils: Utility functions.
- fusion_bench.models: Model definitions and utilities.
- fusion_bench.dataset: Dataset definitions and utilities.
- fusion_bench.tasks: Task definitions and utilities.
- fusion_bench.metrics: Metric definitions and utilities.
- fusion_bench.optim: Implementation of optimizers and learning rate schedulers.
- fusion_bench.constants: Constant definitions.
- fusion_bench.compat (deprecated): Compatibility layer for v0.1.x, this is deprecated and will be removed in future versions.