【选择自由,免费下载】群智能优化算法Python库-MEALPY介绍及使用,包含了215种优化算法

今天分享一个群智能优化算法Python宝库----MEALPY(地址:https://github.com/thieu1995/mealpy)。

MEALPY库是最大的群智能优化算法python库。

自由软件:GNU通用公共许可证(GPL) V3许可证
算法总数:目前有215个.

按分类有基于生物的bio_based,进化的evolutionary_based,人类的human_based,数学的math_based,音乐的music_based,物理的physics_based,群体的swarm_based,系统的system_based。

支持Python版本:3.7,3.8.x,3.9.x,3.10.x,3.11.x
支持项:numpy, scipy, pandas, matplotlib

使用pip安装:

pip install mealpy==2.5.3

从源代码安装
如果你想直接从源代码安装,使用:

git clone https://github.com/thieu1995/mealpy.git
cd mealpy
python setup.py install

安装完成后,您可以像导入任何其他Python模块一样导入Mealpy:

import mealpy

import numpy as np
from mealpy.swarm_based.PSO import OriginalPSO
# 定义函数
def fitness_function(solution):
    return np.sum(solution**2)
# 参数
problem_dict1 = {
"fit_func": fitness_function,
"lb": [-10, -15, -4, -2, -8],
"ub": [10, 15, 12, 8, 20],
"minmax": "min",
}
# PSO参数
epoch = 1000
pop_size = 50
c1 = 2.05
c2 = 2.05
w_min = 0.4
w_max = 0.9
model = OriginalPSO(epoch, pop_size, c1, c2, w_min, w_max)
best_position, best_fitness = model.solve(problem_dict1)
print(f"Solution: {best_position}, Fitness: {best_fitness}")

此外还提供了:求解约束基准函数,多目标基准函数。

可视化:

全局和局部对比

探索阶段和开发阶段对比

运用:

Mealpy +神经网络(取代梯度下降优化器)

Mealpy +神经网络(优化神经网络超参数)

其他应用:

  • 解决背包问题(离散问题)

  • 优化支持向量机SVM (SVC)模型

  • 优化线性回归模型

  • 解决旅行商(Travelling Salesman Problem,TSP)问题

  • 解决特征选择问题

视频教程:

https://mealpy.readthedocs.io/en/latest/pages/general/video_tutorials.html

请引用:


@article{van2023mealpy,
  title={MEALPY: An open-source library for latest meta-heuristic algorithms in Python},
  author={Van Thieu, Nguyen and Mirjalili, Seyedali},
  journal={Journal of Systems Architecture},
  year={2023},
  publisher={Elsevier},
  doi={10.1016/j.sysarc.2023.102871}
}

@article{van2023groundwater,
  title={Groundwater level modeling using Augmented Artificial Ecosystem Optimization},
  author={Van Thieu, Nguyen and Barma, Surajit Deb and Van Lam, To and Kisi, Ozgur and Mahesha, Amai},
  journal={Journal of Hydrology},
  volume={617},
  pages={129034},
  year={2023},
  publisher={Elsevier},
  doi={10.1016/j.jhydrol.2022.129034}
}

总结:

算法很多,应用丰富,可视化简单

  • 4
    点赞
  • 10
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值