All Projects → borzunov → Cpmoptimize

borzunov / Cpmoptimize

Licence: mit
🚀 🐍 Optimizes Python bytecode calculating linear recurrences

Programming Languages

python
139335 projects - #7 most used programming language
bytecode
52 projects

Projects that are alternatives of or similar to Cpmoptimize

Ojalgo
oj! Algorithms
Stars: ✭ 336 (+111.32%)
Mutual labels:  linear-algebra, optimization
Simpeg
Simulation and Parameter Estimation in Geophysics - A python package for simulation and gradient based parameter estimation in the context of geophysical applications.
Stars: ✭ 283 (+77.99%)
Mutual labels:  linear-algebra, optimization
Quant Notes
Quantitative Interview Preparation Guide, updated version here ==>
Stars: ✭ 180 (+13.21%)
Mutual labels:  linear-algebra, optimization
Okalgo
Idiomatic Kotlin extensions for ojAlgo
Stars: ✭ 20 (-87.42%)
Mutual labels:  linear-algebra, optimization
Liblaml
A stand-alone pure C++ library for linear algebra and machine learning
Stars: ✭ 7 (-95.6%)
Mutual labels:  linear-algebra, optimization
Teaching
Teaching Materials for Dr. Waleed A. Yousef
Stars: ✭ 435 (+173.58%)
Mutual labels:  linear-algebra, optimization
Peroxide
Rust numeric library with R, MATLAB & Python syntax
Stars: ✭ 191 (+20.13%)
Mutual labels:  linear-algebra, optimization
Tiramisu
A polyhedral compiler for expressing fast and portable data parallel algorithms
Stars: ✭ 685 (+330.82%)
Mutual labels:  linear-algebra, optimization
Owl
Owl - OCaml Scientific and Engineering Computing @ http://ocaml.xyz
Stars: ✭ 919 (+477.99%)
Mutual labels:  linear-algebra, optimization
Gosl
Linear algebra, eigenvalues, FFT, Bessel, elliptic, orthogonal polys, geometry, NURBS, numerical quadrature, 3D transfinite interpolation, random numbers, Mersenne twister, probability distributions, optimisation, differential equations.
Stars: ✭ 1,629 (+924.53%)
Mutual labels:  linear-algebra, optimization
Evalml
EvalML is an AutoML library written in python.
Stars: ✭ 145 (-8.81%)
Mutual labels:  optimization
Easyengine
Command-line control panel for Nginx Server to manage WordPress sites running on Nginx, PHP, MySQL, and Let's Encrypt
Stars: ✭ 1,881 (+1083.02%)
Mutual labels:  optimization
Galacticoptim.jl
Local, global, and beyond optimization for scientific machine learning (SciML)
Stars: ✭ 155 (-2.52%)
Mutual labels:  optimization
Structured Data Json Ld
Collection of structured data snippets in Google preferred JSON-LD format.
Stars: ✭ 157 (-1.26%)
Mutual labels:  optimization
Deep Learning Specialization Coursera
Deep Learning Specialization courses by Andrew Ng, deeplearning.ai
Stars: ✭ 146 (-8.18%)
Mutual labels:  optimization
Swissarmylib
Collection of helpful utilities we use in our Unity projects.
Stars: ✭ 154 (-3.14%)
Mutual labels:  optimization
Fantasy Basketball
Scraping statistics, predicting NBA player performance with neural networks and boosting algorithms, and optimising lineups for Draft Kings with genetic algorithm. Capstone Project for Machine Learning Engineer Nanodegree by Udacity.
Stars: ✭ 146 (-8.18%)
Mutual labels:  optimization
100daysofmlcode
My journey to learn and grow in the domain of Machine Learning and Artificial Intelligence by performing the #100DaysofMLCode Challenge.
Stars: ✭ 146 (-8.18%)
Mutual labels:  linear-algebra
Georaptor
Python Geohash Compression Tool
Stars: ✭ 143 (-10.06%)
Mutual labels:  optimization
Router
⚡️ A lightning fast HTTP router
Stars: ✭ 158 (-0.63%)
Mutual labels:  optimization

=========== cpmoptimize

A decorator for automatic algorithms optimization via fast matrix exponentiation

.. image:: https://img.shields.io/travis/borzunov/cpmoptimize/master.svg :target: https://travis-ci.org/borzunov/cpmoptimize

.. image:: https://img.shields.io/pypi/v/cpmoptimize.svg :target: https://pypi.python.org/pypi/cpmoptimize

.. image:: https://img.shields.io/pypi/pyversions/cpmoptimize.svg :target: https://pypi.python.org/pypi/cpmoptimize

.. image:: https://img.shields.io/pypi/implementation/cpmoptimize.svg :target: https://pypi.python.org/pypi/cpmoptimize

Installation

You can install the stable version of the library using pip::

sudo pip install cpmoptimize

Or install a previously downloaded and extracted package::

sudo python setup.py install

Basic Example

Suppose we want to calculate the ten millionth Fibonacci number_ using a program in Python. The function with a trivial algorithm is rather slow:

.. code:: python

def fib(n):
    a = 0
    b = 1
    for i in xrange(n):
        a, b = b, a + b
    return a

result = fib(10 ** 7)

# Time: 25 min 31 sec

But if we apply the optimizing decorator, the function will give you the answer much faster:

.. code:: python

from cpmoptimize import cpmoptimize

@cpmoptimize()
def fib(n):
    a = 0
    b = 1
    for i in xrange(n):
        a, b = b, a + b
    return a

result = fib(10 ** 7)

# Time: 18 sec (85x faster)

.. _Fibonacci number: https://en.wikipedia.org/wiki/Fibonacci_number

Description

Actually, the decorator disassembles bytecode of a function using pretty byteplay library, analyzes the code, and tries to reduce time complexity_ of the algorithm used in it using fast matrix exponentiation_.

.. _time complexity: https://en.wikipedia.org/wiki/Time_complexity .. _fast matrix exponentiation: https://en.wikipedia.org/wiki/Exponentiation_by_squaring

The decorator uses a method implemented by Alexander Skidanov_ in his simple optimizing interpreter_.

.. _Alexander Skidanov: https://github.com/SkidanovAlex .. _optimizing interpreter: https://github.com/SkidanovAlex/interpreter

A detailed description of the library (including an idea explanation and an interface reference) is available in English_ and Russian_.

.. _English: http://kukuruku.co/hub/algorithms/automatic-algorithms-optimization-via-fast-matrix-exponentiation .. _Russian: http://habrahabr.ru/post/236689/

Author

Copyright (c) 2014, 2015 Alexander Borzunov

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].