Skip to main content

Training code and pre-trained models for Neural Cellular Automata on different datasets and tasks

Project description

NCALab

NCALab makes it easy to create Neural Cellular Automata (NCA) implementations for various downstream tasks, such as image segmentation, classification and synthesis.

docs python-package manuscript

NCALab Logo

Features

Features of NCALab include:

  • Easy training and evaluation of NCA models
  • Cascaded multi-scale training
  • Tensorboard integration with default presets
  • Training with k-fold cross-validation
  • Convenience features: Fixing random seeds, selecting compute devices, data processing

Getting started

Perhaps the best way of getting started with NCALab is to take a look at the provided usage example tasks, starting with the Growing Emoji task.

Usage Example Tasks

So far, the following example tasks are implemented in NCALab:

  • Image Generation:
    • Growing NCA for emoji generation
      • Training and evaluation
      • Fine-tuning of a pre-trained emoji generator
      • Hyperparameter search
  • Image Classification:
    • Self-classifying MNIST digits
    • MedMNIST image classification (PathMNIST, BloodMNIST, DermaMNIST)
  • Image Segmentation:
    • Endoscopic polyp segmentation (Kvasir-SEG, public)

You can find those example tasks inside the tasks/ directory and its subfolders.

Growing Lizard Example

A good starting point to get started with NCAs is the famous Growing Lizard emoji example.

uv run tasks/growing_emoji/train_growing_emoji.py

Run this script to generate a GIF of the trained model's prediction:

uv run tasks/growing_emoji/eval_growing_emoji.py

Animation of a growing lizard emoji

Installation

Run

pip install ncalab

to install the latest release or

pip install git+https://github.com/MECLabTUDA/NCALab

for the most recent commit of NCALab. We recommend to install NCALab in a virtual environment.

Tensorboard integration

We recommend you to monitor your training progress in Tensorboard. To launch tensorboard, run

uv run tensorboard --logdir=runs

in a separate terminal. Once it is running, it should show you the URL the tensorboard server is running on, which is localhost:6006 by default. Alternatively, you may use the tensorboard integration of your IDE.

For Developers

Type checking:

uv run mypy ncalab

Static code analysis:

uv run ruff check ncalab

Testing:

uv run pytest

How to Cite

Coming soon.

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

ncalab-0.2.0.tar.gz (14.6 kB view details)

Uploaded Source

Built Distribution

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

ncalab-0.2.0-py3-none-any.whl (10.2 kB view details)

Uploaded Python 3

File details

Details for the file ncalab-0.2.0.tar.gz.

File metadata

  • Download URL: ncalab-0.2.0.tar.gz
  • Upload date:
  • Size: 14.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for ncalab-0.2.0.tar.gz
Algorithm Hash digest
SHA256 7bf79841119ca543360c41b0e6e98d6d286b4e07402ae6b6f08b3241cfe95a60
MD5 1715be70025d90af03344b0271af8fda
BLAKE2b-256 bc8b2dcf89362e5cb2270be02c725c6e3223cceffc7e8d268a7d8aa0797bf24d

See more details on using hashes here.

Provenance

The following attestation bundles were made for ncalab-0.2.0.tar.gz:

Publisher: python-publish.yml on MECLabTUDA/NCALab

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ncalab-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: ncalab-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 10.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for ncalab-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ace33b2cb599b408a988093b88ec083e823f8c3a87b6fc6b82275df16aef327c
MD5 668edf47ec0df9b7a7ab6a7d8897f251
BLAKE2b-256 93127cd92dc7992d3d9ac1a407d2880060a7aa26a6d7ba08fb16d08cf7a196bd

See more details on using hashes here.

Provenance

The following attestation bundles were made for ncalab-0.2.0-py3-none-any.whl:

Publisher: python-publish.yml on MECLabTUDA/NCALab

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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