python中的质量分集算法
qdp的Python项目详细描述
软件包qdpy实现了最新的质量多样性算法:地图精英、cvt地图精英、nslc、sail等。 qd算法可以直接访问,但qdpy也包括构建块,这些构建块可以很容易地组装在一起构建自己的qd算法。它可以用于并行机制和分布式环境中。
这个包需要Python3.6+。
- qdpy包含以下功能:
- 对不同容器的通用支持:网格、新奇档案、总体等
- 量子点优化算法:随机搜索方法,准随机方法,进化算法
- 支持多目标优化方法
- 可以使用不是为qd设计的优化方法,例如[cma-es](https://arxiv.org/pdf/1604.00772.pdf)
- 计算的并行化,使用并行库,如多处理、concurrent.futures或[spook](https://github.com/soravux/scoop)
- 易于与流行的[deap](https://github.com/DEAP/deap)进化计算框架集成
安装
- qdpy需要python 3.6+。它可以与以下组件一起安装:
- pip3安装qdpy
- qdpy包括需要安装额外软件包的可选功能:
- CMA用于CMA-ES支持
- deap与deap库集成
- 表格以HDF5格式输出结果文件
- tqdm显示显示优化进度的进度条
- colorama为漂亮的打印输出添加颜色
- 您可以使用以下命令安装qdpy和所有这些可选依赖项:
- pip3安装qdpy[all]
- 最新版本可以从gitlab存储库安装:
- pip3安装git+https://gitlab.com/leo.cazenille/qdpy.git@master
示例
来自python外壳:
from qdpy import algorithms, containers, benchmarks, plots # Create container and algorithm. Here we use MAP-Elites, by illuminating a Grid container by evolution. grid = containers.Grid(shape=(64,64), max_items_per_bin=1, fitness_domain=((0., 1.),), features_domain=((0., 1.), (0., 1.))) algo = algorithms.RandomSearchMutPolyBounded(grid, budget=60000, batch_size=500, dimension=3, optimisation_task="maximisation") # Create a logger to pretty-print everything and generate output data files logger = algorithms.AlgorithmLogger(algo) # Define evaluation function eval_fn = algorithms.partial(benchmarks.illumination_rastrigin_normalised, nb_features = len(grid.shape)) # Run illumination process ! best = algo.optimise(eval_fn) # Print results info print(algo.summary()) # Plot the results plots.default_plots_grid(logger) print("All results are available in the '%s' pickle file." % logger.final_filename)
用法,文档
请转到gitlab存储库主页(https://gitlab.com/leo.cazenille/qdpy)和文档主页(https://leo.cazenille.gitlab.io/qdpy/)。
Author: | Leo Cazenille, 2018-* |
---|---|
License: | LGPLv3, see LICENSE file. |