Skip to main content

Cellular Automata Accelerated in JAX

Project description

CAX: Cellular Automata Accelerated in JAX

logo
PyPI - Python Version PyPI - Version Paper X URL

CAX is a high-performance and flexible open-source library designed to accelerate artificial life research. 🧬

Overview 🔎

Are you interested in emergence, self-organization, or open-endedness? Whether you're a researcher or just curious about the fascinating world of artificial life, CAX is your digital lab! 🔬

Designed for speed and flexibility, CAX allows you to easily experiment with self-organizing behaviors and emergent phenomena. 🧑‍🔬

Get started here Colab

Why CAX? 💡

CAX supports discrete and continuous systems, including neural cellular automata, across any number of dimensions. Beyond traditional cellular automata, it also handles particle systems and more, all unified under a single, intuitive API.

Rich 🎨

CAX provides a comprehensive collection of 15+ ready-to-use systems. From simulating one-dimensional elementary cellular automata to training three-dimensional self-autoencoding neural cellular automata, or even creating beautiful Lenia simulations, CAX provides a versatile platform for exploring the rich world of self-organizing systems.

Flexible 🧩

CAX makes it easy to extend existing systems or build custom ones from scratch for endless experimentation and discovery. Design your own experiments to probe the boundaries of artificial open-ended evolution and emergent complexity.

Fast 🚀

CAX is built on top of the JAX/Flax ecosystem for speed and scalability. The library benefits from vectorization and parallelization on various hardware accelerators such as CPU, GPU, and TPU. This allows you to scale your experiments from small prototypes to massive simulations with minimal code changes.

Tested & Documented 📚

The library is thoroughly tested and documented with numerous examples to get you started! Our comprehensive guides walk you through everything from basic cellular automata to advanced neural implementations.

Implemented Systems 🦎

Cellular Automata Reference Example
Elementary Cellular Automata Wolfram (2002) Colab
Conway's Game of Life Gardner (1970) Colab
Lenia Chan (2020) Colab
Flow Lenia Plantec et al. (2022) Colab
Particle Lenia Mordvintsev et al. (2022) Colab
Particle Life Mohr (2018) Colab
Boids Reynolds (1987) Colab
Growing Neural Cellular Automata Mordvintsev et al. (2020) Colab
Growing Conditional Neural Cellular Automata Sudhakaran et al. (2022) Colab
Growing Unsupervised Neural Cellular Automata Palm et al. (2021) Colab
Diffusing Neural Cellular Automata Faldor et al. (2024) Colab
Self-classifying MNIST Digits Randazzo et al. (2020) Colab
Self-autoencoding MNIST Digits Faldor et al. (2024) Colab
1D-ARC Neural Cellular Automata Faldor et al. (2024) Colab
Attention-based Neural Cellular Automata Tesfaldet et al. (2022) Colab

Getting Started 🚦

Here, you can see the basic CAX API usage with Conway's Game of Life:

import jax
import jax.numpy as jnp
from flax import nnx

from cax.cs.life import Life

seed = 0

num_steps = 128
spatial_dims = (32, 32)
channel_size = 1
rule_golly = "B3/S23"  # Conway's Game of Life

key = jax.random.key(seed)
rngs = nnx.Rngs(seed)

birth, survival = Life.birth_survival_from_string(rule_golly)
cs = Life(birth=birth, survival=survival, rngs=rngs)

state_init = jax.random.bernoulli(key, p=0.5, shape=(*spatial_dims, channel_size)).astype(
	jnp.float32
)
state_final = cs(state_init, num_steps=num_steps, sow=True)

For a more detailed overview, get started with this notebook Colab

Installation ⚙️

You will need Python 3.11 or later, and a working JAX installation installed in a virtual environment.

Then, install CAX from PyPi with uv:

uv pip install cax

or with pip:

pip install cax

Citing CAX 📝

If you use CAX in your research, please cite the following paper:

@inproceedings{cax,
	title = {{CAX}: {Cellular} {Automata} {Accelerated} in {JAX}},
	volume = {2025},
	url = {https://proceedings.iclr.cc/paper_files/paper/2025/file/19206a6ed5ed0aaeed440448dfc5cf7e-Paper-Conference.pdf},
	booktitle = {International {Conference} on {Representation} {Learning}},
	author = {Faldor, Maxence and Cully, Antoine},
	editor = {Yue, Y. and Garg, A. and Peng, N. and Sha, F. and Yu, R.},
	year = {2025},
	pages = {8947--8960},
	keywords = {artificial life, emergence, self-organization, open-endedness, cellular automata, neural cellular automata},
}

Contributing 👷

Contributions are welcome! If you find a bug or are missing your favorite self-organizing system, please open an issue or submit a pull request following our contribution guidelines 🤗.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cax-0.3.3.tar.gz (23.6 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cax-0.3.3-py3-none-any.whl (79.5 kB view details)

Uploaded Python 3

File details

Details for the file cax-0.3.3.tar.gz.

File metadata

  • Download URL: cax-0.3.3.tar.gz
  • Upload date:
  • Size: 23.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.3

File hashes

Hashes for cax-0.3.3.tar.gz
Algorithm Hash digest
SHA256 42da336358941edecd2ae8a0ca47466478ee83eba4a361fd7a81f01bafa2a538
MD5 30507bfa7288bc516f5a2ce9e3ebee80
BLAKE2b-256 878072914ed1edf9b0f99584ce2f6d5ada76f63c7bba197270ba6ac0cbeb96e7

See more details on using hashes here.

File details

Details for the file cax-0.3.3-py3-none-any.whl.

File metadata

  • Download URL: cax-0.3.3-py3-none-any.whl
  • Upload date:
  • Size: 79.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.3

File hashes

Hashes for cax-0.3.3-py3-none-any.whl
Algorithm Hash digest
SHA256 09e986f47b64f584d4ba8bc13399de5402452e06bb514c39c37447a7f41ad8f3
MD5 3e7d572246a968aeab5a42d6eb6696a0
BLAKE2b-256 790070de83abba361fd363e5b1f8dd5ba16e824ad458d0b4ddd37904c68be4fb

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page