Metadata-Version: 2.1
Name: evox
Version: 0.0.2
Summary: evox
Author-email: Bill Huang <bill.huang2001@gmail.com>, Christina Lee <1315552992@qq.com>, Zhenyu Liang <zhenyuliang97@gmail.com>
License: BSD 3-Clause License
        
        Copyright (c) 2022, EMI-Group
        All rights reserved.
        
        Redistribution and use in source and binary forms, with or without
        modification, are permitted provided that the following conditions are met:
        
        1. Redistributions of source code must retain the above copyright notice, this
           list of conditions and the following disclaimer.
        
        2. Redistributions in binary form must reproduce the above copyright notice,
           this list of conditions and the following disclaimer in the documentation
           and/or other materials provided with the distribution.
        
        3. Neither the name of the copyright holder nor the names of its
           contributors may be used to endorse or promote products derived from
           this software without specific prior written permission.
        
        THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
        AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
        IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
        DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
        FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
        DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
        SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
        CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
        OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
        OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
        
Project-URL: Homepage, https://github.com/EMI-Group/evox
Project-URL: Bug Tracker, https://github.com/EMI-Group/evox/issues
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: BSD License
Classifier: Intended Audience :: Science/Research
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.7
Description-Content-Type: text/markdown
Provides-Extra: test
Provides-Extra: gym
Provides-Extra: neuroevolution
Provides-Extra: distributed
Provides-Extra: full
License-File: LICENSE

# EvoX: A Distributed GPU-accelerated Library for Evolutionary Computation

<h4 align="left">
  [<a href="https://evox.readthedocs.io/">Docs</a>]
  [<a href="https://arxiv.org/abs/2301.12457">Paper</a>]
</h4>

## Features

- Single-objective and multi-objective algorithms.
- GPU computing.
- Easy to use distributed pipeline.
- Support a wide range of problems.

### Index

- [Getting started](#getting-started)
- [Example](#exmaple)

## Installation

``
pip install evox
``

## Getting started

To start with, import `evox`

```python
import evox
from evox import algorithm, problem, pipeline
```

Then, create an algorithm and a problem:

```python
pso = algorithms.PSO(
    lb=jnp.full(shape=(2,), fill_value=-32),
    ub=jnp.full(shape=(2,), fill_value=32),
    pop_size=100,
)
ackley = problems.classic.Ackley()
```

The algorithm and the problem are composed together using `pipeline`:

```python
pipeline = pipelines.StdPipeline(pso, ackley)
```

To initialize the whole pipeline, call `init` on the pipeline object with a PRNGKey. Calling `init` will recursively initialize a tree of objects, meaning the algorithm pso and problem ackley are automatically initialize as well.

```python
key = jax.random.PRNGKey(42)
state = pipeline.init(key)
```

To run the pipeline, call `step` on the pipeline.

```python
# run the pipeline for 100 steps
for i in range(100):
    state = pipeline.step(state)
```

For more detailed usage, please refer to our [documentation](https://evox.readthedocs.io/).

## Exmaple

The [example](https://github.com/EMI-Group/evox/tree/main/examples) folder has many examples on how to use EvoX.
