【24h】

Cython for Speeding-up Genetic Algorithm

机译:Cython加速遗传算法

获取原文

摘要

This paper proposes a library for implementing the genetic algorithm using Python mainly in NumPy and speeding-up its execution using Cython. The preliminary Python implementation is inspected for possible optimizations. The 4 main changes include statically defining data types for the NumPy arrays, specifying the data type of the array elements in addition to the number of dimensions, using indexing for looping through the arrays, and finally disabling some unnecessary features in Cython. Using Cython, the NumPy array processing is 1250 times faster than CPython. The Cythonized version of the genetic algorithm is 18 times faster than the Python version.
机译:本文提出了一种用于使用Python实现遗传算法的库,主要用numpy和使用cython加速其执行。检查可能的优化初步Python实现。 4个主要变化包括静态定义Numpy阵列的数据类型,除了维度的数量之外,还使用索引来指定数组元素的数据类型,使用索引循环通过阵列,最后禁用纱花中的一些不必要的功能。使用Cython,Numpy数组处理比CPython快1250倍。遗传算法的彩灾版本比Python版本快18倍。

著录项

相似文献

  • 外文文献
  • 中文文献
  • 专利
获取原文

客服邮箱:kefu@zhangqiaokeyan.com

京公网安备:11010802029741号 ICP备案号:京ICP备15016152号-6 六维联合信息科技 (北京) 有限公司©版权所有
  • 客服微信

  • 服务号