Cython for Speeding-up Genetic Algorithm
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,...
Saved in:
| Published in | 2020 International Conference on Electrical and Information Technologies (ICEIT) pp. 1 - 4 |
|---|---|
| Main Authors | , |
| Format | Conference Proceeding |
| Language | English |
| Published |
IEEE
01.03.2020
|
| Subjects | |
| Online Access | Get full text |
| DOI | 10.1109/ICEIT48248.2020.9113210 |
Cover
| Summary: | 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. |
|---|---|
| DOI: | 10.1109/ICEIT48248.2020.9113210 |