• Stars
    star
    581
  • Rank 76,901 (Top 2 %)
  • Language
    Python
  • License
    Apache License 2.0
  • Created about 7 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

๐Ÿฆ Opytimizer is a Python library consisting of meta-heuristic optimization algorithms.

Opytimizer: A Nature-Inspired Python Optimizer

Latest release DOI Build status Open issues License

Welcome to Opytimizer.

Did you ever reach a bottleneck in your computational experiments? Are you tired of selecting suitable parameters for a chosen technique? If yes, Opytimizer is the real deal! This package provides an easy-to-go implementation of meta-heuristic optimizations. From agents to search space, from internal functions to external communication, we will foster all research related to optimizing stuff.

Use Opytimizer if you need a library or wish to:

  • Create your optimization algorithm;
  • Design or use pre-loaded optimization tasks;
  • Mix-and-match different strategies to solve your problem;
  • Because it is fun to optimize things.

Read the docs at opytimizer.readthedocs.io.

Opytimizer is compatible with: Python 3.6+.


Package guidelines

  1. The very first information you need is in the very next section.
  2. Installing is also easy if you wish to read the code and bump yourself into, follow along.
  3. Note that there might be some additional steps in order to use our solutions.
  4. If there is a problem, please do not hesitate, call us.
  5. Finally, we focus on minimization. Take that in mind when designing your problem.

Citation

If you use Opytimizer to fulfill any of your needs, please cite us:

@misc{rosa2019opytimizer,
    title={Opytimizer: A Nature-Inspired Python Optimizer},
    author={Gustavo H. de Rosa, Douglas Rodrigues and Joรฃo P. Papa},
    year={2019},
    eprint={1912.13002},
    archivePrefix={arXiv},
    primaryClass={cs.NE}
}

Getting started: 60 seconds with Opytimizer

First of all. We have examples. Yes, they are commented. Just browse to examples/, chose your subpackage, and follow the example. We have high-level examples for most tasks we could think of and amazing integrations (Learnergy, NALP, OPFython, PyTorch, Scikit-Learn, Tensorflow).

Alternatively, if you wish to learn even more, please take a minute:

Opytimizer is based on the following structure, and you should pay attention to its tree:

- opytimizer
    - core
        - agent
        - block
        - cell
        - function
        - node
        - optimizer
        - space
    - functions
        - constrained
        - multi_objective
    - math
        - distribution
        - general
        - hyper
        - random
    - optimizers
        - boolean
        - evolutionary
        - misc
        - population
        - science
        - social
        - swarm
    - spaces
        - boolean
        - graph
        - grid
        - hyper_complex
        - pareto
        - search
        - tree
    - utils
        - callback
        - constant
        - exception
        - history
        - logging
    - visualization
        - convergence
        - surface

Core

Core is the core. Essentially, it is the parent of everything. You should find parent classes defining the basis of our structure. They should provide variables and methods that will help to construct other modules.

Functions

Instead of using raw and straightforward functions, why not try this module? Compose high-level abstract functions or even new function-based ideas in order to solve your problems. Note that for now, we will only support multi-objective function strategies.

Math

Just because we are computing stuff does not means that we do not need math. Math is the mathematical package containing low-level math implementations. From random numbers to distribution generation, you can find your needs on this module.

Optimizers

This is why we are called Opytimizer. This is the heart of heuristics, where you can find a large number of meta-heuristics, optimization techniques, anything that can be called an optimizer. Please take a look at the available optimizers.

Spaces

One can see the space as the place that agents will update their positions and evaluate a fitness function. However, the newest approaches may consider a different type of space. Thinking about that, we are glad to support diverse space implementations.

Utils

This is a utility package. Common things shared across the application should be implemented here. It is better to implement once and use as you wish than re-implementing the same thing repeatedly.

Visualization

Everyone needs images and plots to help visualize what is happening, correct? This package will provide every visual-related method for you. Check a specific variable convergence, your fitness function convergence, plot benchmark function surfaces, and much more!


Installation

We believe that everything has to be easy. Not tricky or daunting, Opytimizer will be the one-to-go package that you will need, from the first installation to the daily tasks implementing needs. If you may just run the following under your most preferred Python environment (raw, conda, virtualenv, whatever):

pip install opytimizer

Alternatively, if you prefer to install the bleeding-edge version, please clone this repository and use:

pip install -e .

Environment configuration

Note that sometimes, there is a need for additional implementation. If needed, from here, you will be the one to know all of its details.

Ubuntu

No specific additional commands are needed.

Windows

No specific additional commands are needed.

MacOS

No specific additional commands are needed.


How-To-Use: Minimal Example

Take a look at a quick working example of Opytimizer. Note that we are not passing many extra arguments nor additional information to the procedure. For more complex examples, please check our examples/ folder.

import numpy as np

from opytimizer import Opytimizer
from opytimizer.core import Function
from opytimizer.optimizers.swarm import PSO
from opytimizer.spaces import SearchSpace

def sphere(x):
  return np.sum(x ** 2)

n_agents = 20
n_variables = 2
lower_bound = [-10, -10]
upper_bound = [10, 10]

space = SearchSpace(n_agents, n_variables, lower_bound, upper_bound)
optimizer = PSO()
function = Function(sphere)

opt = Opytimizer(space, optimizer, function)
opt.start(n_iterations=1000)

Support

We know that we do our best, but it is inevitable to acknowledge that we make mistakes. If you ever need to report a bug, report a problem, talk to us, please do so! We will be available at our bests at this repository.


More Repositories

1

learnergy

๐Ÿ’ก Learnergy is a Python library for energy-based machine learning models.
Python
60
star
2

modelos_latex

๐Ÿ“ Modelos simples e compreensรญveis em LaTeX, adaptados para a Faculdade de Ciรชncias da UNESP.
TeX
48
star
3

viviner

๐Ÿท Scraps data from Vivino and collects outstanding wine-based meta-data.
Python
36
star
4

opfython

๐ŸŒณ A Python-inspired implementation of the Optimum-Path Forest classifier.
Python
31
star
5

nalp

๐Ÿ—ฃ๏ธ NALP is a library that covers Natural Adversarial Language Processing.
Python
23
star
6

leaflyer

๐Ÿ€ Scraps data from Leafly and collects amazing weed-based meta-data.
Python
17
star
7

evolutionary_ensembles

๐Ÿ“„ Official implementation regarding the paper "Creating Classifier Ensembles through Meta-heuristic Algorithms for Aerial Scene Classification".
Python
8
star
8

libras_decoder

โœ‹ A hand tracking system that integrates a classification architecture which decodes gestual alphabet into text.
Python
8
star
9

opytimark

๐Ÿ“ˆ Opytimark is a Python library consisting of optimization benchmarking functions.
Python
7
star
10

go_api_boilerplate

โš™๏ธ A Go-based API boilerplate for speeding up future projects.
Go
7
star
11

jucesp_rpa

๐Ÿค– An RPA-based tool for extracting information over JUCESP.
Python
6
star
12

statys

๐Ÿ“Š Statistical analyzers to provide more robust comparisons between Machine Learning techniques.
Python
5
star
13

mh_deep_application

๐Ÿ Nature-Inspired Optimization Applied to Deep Learning for ICMC/USP mini-course.
Python
4
star
14

iris_recognition

๐Ÿ‘๏ธ An easy-to-use iris recognition system based on Daugman's approach.
MATLAB
4
star
15

textformer

๐Ÿ”ฎ Transformer-based architectures for handling text generation and translation.
Python
3
star
16

text_augmenter

โœ’๏ธ RNNs and Transformers text-based augmentation for ICMC/USP mini-course.
TeX
3
star
17

dualing

๐Ÿพ Dualing is a Python library that implements dual-based neural learning.
Python
3
star
18

multi_activation

๐Ÿ“„ Official PyTorch and Tensorflow implementations regarding the Multi Activation layer.
Python
2
star
19

LibOPT4Caffe

โ˜• Integration library, built to assimilate LibOPT and Caffe together.
Protocol Buffer
2
star
20

py4research

๐Ÿ“ฆ A step-by-step tutorial on how to build a Python package for research.
TeX
2
star
21

synthetic_rbms

๐Ÿ“„ Official implementation regarding the paper "Fast Ensemble Learning Using Adversarially-Generated Restricted Boltzmann Machines".
Python
2
star
22

politico_honesto

๐Ÿ’ธ An RPA-based assistant that extracts information about a candidate over TSE.
Python
2
star
23

textfier

๐Ÿ“ Textfier provides an easier interface to text-based modifiers.
Python
2
star
24

annotator

โœ๏ธ A Doccano-based project designed to fulfill ML-based needs.
Python
2
star
25

apostila_ml

๐Ÿ“‹ Apostila para o curso de Aprendizado de Mรกquina do programa de Pรณs-Graduaรงรฃo em Ciรชncia da Computaรงรฃo da UNESP.
TeX
2
star
26

dbn_tuning

๐Ÿ“„ Official implementation regarding the chapter "Fine-Tuning Deep Belief Networks with Harmony-Based Optimization".
Python
2
star
27

python_api_boilerplate

โš™๏ธ A Python-based API boilerplate for speeding up future projects.
Python
1
star
28

loss_programming

๐Ÿ“„ Official implementation regarding the paper "Programmatically Evolving Losses in Machine Learning".
Python
1
star
29

crypto_meleon

๐ŸŠ Changes CryptoMeleon's colors with just a few lines of code.
Python
1
star
30

amazonas

๐Ÿ’ง An OpenSea fully-customizable integration that allows the creation of smart contracts.
Solidity
1
star
31

crbm_tuning

๐Ÿ“„ Official implementation regarding the paper "Adapting Convolutional Restricted Boltzmann Machines Through Evolutionary Optimization".
Python
1
star
32

ghost_reader

๐Ÿ‘ป An image-to-text and text-to-voice application focused on accessibility.
Python
1
star
33

tsgan_nlg

๐Ÿ“„ Official implementation regarding the paper "Natural Language Generation With Similarity-Based Adversarial Learning".
Python
1
star
34

mh_feature_selection

๐Ÿ“„ Official implementation regarding the paper "A Survey on Metaheuristic Approaches to Feature Selection".
Python
1
star
35

mh_fine_tuning

๐Ÿ“„ Official implementation regarding the paper "Improving Pre-Trained Weights Through Meta-Heuristic Fine-Tuning".
Python
1
star