Giter VIP home page Giter VIP logo

pyreal's Introduction

pyreal

Implementation in Python of evolutionary algorithms, used to make an study of the performance in Python using Cython. This code is GPLv3.

You can read a post about that in http://dmolina.github.com/blog/2012/07/15/increasing-performance-python/, this is the source code used in this comparisons.

Install

To install, you need Python 2.6, [Boost::python] (http://www.boost.org/doc/libs/1_50_0/libs/python/doc/ "Boost::Python"), and [CMake] (http://cmake.org/ "CMake") to compile.

The install process has several steps, but you can only run the ./compile script:

./compile

and everything should be compiled.

Run

You can use the algorithm in the following way:

Usage: runcec.py [options]

Options: -h, --help show this help message and exit -f FUNCTION, --function=FUNCTION set the function to optimise (number between [1,25]) -d FUNCTION, --dimension=FUNCTION set the dimensionality (2|10|30|50) -t FUNCTION, --times=FUNCTION set the run number (default=25)

Example: python runcec.py -f 1 -d 10 -t 5

Python and Cython versions

By default, the algorithm uses the cython version. If you want to repeat the experiments of the post, or you want to study the differences, these methods are implemented in two modules:

  • utils.py : performance critic methods using python.
  • cutils.py: performance critic method using cython.

To set the the slow (utils.py) or fast (cutils.py) you only have to comment (or uncomment) one of the following lines:

from cutils import getParentByNAM,crossBLX,getBestWorst #uncomment for fast version (cython) #from utils import getParentByNAM,crossBLX,getBestWorst #uncomment for slow version (python)

pyreal's People

Stargazers

Ignacio Aguilera Martos avatar Graeme Glass avatar

Watchers

Daniel Molina avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.