-
-
Notifications
You must be signed in to change notification settings - Fork 988
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
遗传算法的交叉概率默认是多少,可以调吗? #79
Comments
默认算子是全部交叉的,可以只定义算子去调整 |
可以贡献代码吗?我感觉这个库还有很多东西需要补全的. 比如交叉概率等.
|
可以 |
请问这个调交叉率的代码在哪里呢?能共享一下吗? |
|
谢谢。还有一个问题想问下,这个算法可以导出每一代的最优值吗?如何实现呢?
…On Mon, Jun 28, 2021 at 7:34 AM 郭飞 ***@***.***> wrote:
from sko.GA import GA
from sko.operators import crossover
ga = GA(func=lambda x: x[0] ** 2 + (x[1] - 0.05) ** 2 + (x[2] - 0.5) ** 2
, n_dim=3, size_pop=100, max_iter=500, lb=[-1, -10, -5], ub=[2, 10, 2],
precision=[1e-7, 1e-7, 1])
ga.register(operator_name='crossover', operator=crossover.crossover_2point_prob, crossover_prob=0.5)
best_x, best_y = ga.run()
print('best_x:', best_x, '\n', 'best_y:', best_y)
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#79 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/APF2ZCSG4VKXT7FJLXZACZDTVBT4JANCNFSM4RKQBE6Q>
.
|
https://github.com/guofei9987/scikit-opt/blob/master/examples/demo_ga.py |
我在代码里输入了这个来设置交叉率,但是报错。请问是什么问题呢?
[image: image.png]
[image: image.png]
…On Fri, Jul 2, 2021 at 8:39 AM 郭飞 ***@***.***> wrote:
谢谢。还有一个问题想问下,这个算法可以导出每一代的最优值吗?如何实现呢?
… <#m_-4931148214033621750_>
On Mon, Jun 28, 2021 at 7:34 AM 郭飞 *@*.***> wrote: from sko.GA import GA
from sko.operators import crossover ga = GA(func=lambda x: x[0] ** 2 +
(x[1] - 0.05) ** 2 + (x[2] - 0.5) ** 2 , n_dim=3, size_pop=100,
max_iter=500, lb=[-1, -10, -5], ub=[2, 10, 2], precision=[1e-7, 1e-7, 1])
ga.register(operator_name='crossover',
operator=crossover.crossover_2point_prob, crossover_prob=0.5) best_x,
best_y = ga.run() print('best_x:', best_x, '\n', 'best_y:', best_y) — You
are receiving this because you commented. Reply to this email directly,
view it on GitHub <#79 (comment)
<#79 (comment)>>,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/APF2ZCSG4VKXT7FJLXZACZDTVBT4JANCNFSM4RKQBE6Q
.
https://github.com/guofei9987/scikit-opt/blob/master/examples/demo_ga.py
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#79 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/APF2ZCWOVITL54TGS66AE4LTVW6SFANCNFSM4RKQBE6Q>
.
|
|
No description provided.
The text was updated successfully, but these errors were encountered: