作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我已经实现了一种遗传算法,它使用基于 Regularized Evolution for Image Classifier Architecture Search 中描述的方法的繁殖方法。 .
描述再现方法的最小伪代码:
num_steps = 1e1000
step = 0
1. while step < total_steps:
1a. winner, loser = tournament_selection(population)
1b. offspring = mutate(winner)
1c. replace loser with offspring
1d. step++
作者在
1提到上面的循环是通过将上面的循环分布在多个工作人员上来并行化的。他们还提到在
released source 中给出了完整的实现。 ,但链接的代码不包含相关的并行化部分。
最佳答案
你可以想象一个如下的并行化方案(有 n 个 worker ):
num_steps = 1000
num_cycles = num_steps / n
cycle = 0
while cycle < num_cycles:
children = []
for i in range(n):
children.append(start_worker(current_pop))
for i in range(n):
current_population.remove(oldest)
current_population.append(children)
cycle += 1
start_worker(pop):
winner, loser = tournament_selection(population)
offspring = mutate(winner)
offspring.fitness = compute_fitness(offspring)
return offspring
这样,在每一步您都会创建 n 个锦标赛并生成 n 个子项。我认为并行化会很有效,因为计算成本通常存在于 compute_fitness() 方法中。
关于parallel-processing - 串行繁殖遗传算法的并行化,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68244391/
如何将 solr 与 heritrix 集成? 我想使用 heritrix 归档一个站点,然后使用 solr 在本地索引和搜索该文件。 谢谢 最佳答案 使用 Solr 进行索引的问题在于它是一个纯文本
我的任务: 创建一个程序来仅使用基元(如三角形或其他东西)复制图片(作为输入给出)。该程序应使用进化算法来创建输出图片。 我的问题: 我需要发明一种算法来创建种群并检查它们(它们与输入图片的匹配程度
我看过几篇文章和文章,建议使用模拟退火等方法来避免局部最小值/最大值问题。 我不明白为什么如果您从足够大的随机人口开始,这将是必要的。 这只是确保初始人口实际上足够大和随机的另一项检查吗?或者这些技术
我是一名优秀的程序员,十分优秀!