Skip to main content

PyNAS, a Python package for Neural Architecture Search experiments

Project description

ESA Phi-lab and PyNAS banner

CI Python 3.11+ Version License: Apache 2.0 DOI

PyNAS

PyNAS is a Python framework for Neural Architecture Search (NAS) experiments focused on resource-constrained, edge-deployable deep learning models. The project is developed by ESA Phi-lab with Little Place Lab and targets workflows where model accuracy, memory footprint, and deployment cost must be considered together.

Why PyNAS

PyNAS provides building blocks for evolutionary NAS experiments, with an emphasis on compact neural networks for onboard and edge AI use cases.

Area What is included
Architecture generation Utilities for generating, parsing, and rebuilding architecture codes
Search operators Genetic mutation and single-point crossover primitives
Model blocks Convolutional, pooling, activation, residual, classifier, and U-Net components
Training utilities PyTorch Lightning modules, segmentation losses, metrics, and early stopping helpers
Data utilities Hugging Face dataset download helper with retry handling

Project Status

Item Status
Package name esa-pynas
Version 0.1.0
Python support >=3.11,<3.15
Distribution Local checkout; PyPI publication planned
License Apache 2.0
Development status Alpha / research preview

Installation

PyNAS uses uv for reproducible dependency management. From a local checkout:

uv sync --locked

For development and verification:

uv sync --locked --dev
uv run pytest
uv run ruff format --check src scripts data tests
uv run ruff check src scripts data tests

The default lock configuration uses CPU PyTorch wheels for deterministic Windows, Linux, and macOS CI environments. For CUDA-enabled training workloads, install the PyTorch wheel index that matches your driver and hardware before running experiments.

Quick Start

Generate and inspect a candidate architecture code:

from pynas.core.architecture_builder import (
    generate_code_from_parsed_architecture,
    generate_random_architecture_code,
    parse_architecture_code,
)

architecture_code = generate_random_architecture_code()
parsed_architecture = parse_architecture_code(architecture_code)
round_tripped_code = generate_code_from_parsed_architecture(parsed_architecture)

print(architecture_code)
print(round_tripped_code)

Use the public package interface for training-related utilities:

from pynas import (
    CategoricalCrossEntropyLoss,
    GenericLightningSegmentationNetwork,
    Individual,
    calculate_iou,
)

Data

The burned-area segmentation dataset referenced by this project is hosted on Hugging Face:

Install the optional data dependencies and run the downloader:

uv sync --locked --extra data
uv run python data/download_hf_datasets.py

The downloader supports dataset and model repositories from the Hugging Face Hub, retry handling for transient network failures, progress reporting, and custom local output directories. Edit the repo_ids list in data/download_hf_datasets.py to change the default download targets.

Repository Layout

.
├── data/                 # Dataset download utilities and data notes
├── docs/                 # Documentation assets and static documentation files
├── examples/             # Usage examples and demos
├── notebooks/            # Experiment and walkthrough notebooks
├── papers/               # Research manuscript assets
├── scripts/              # Training and data-loading scripts
├── src/pynas/            # PyNAS Python package
│   ├── blocks/           # Neural network building blocks
│   ├── core/             # Architecture, population, configuration, and model logic
│   ├── opt/              # Evolutionary optimization operators
│   └── train/            # Losses, metrics, and training helpers
└── tests/                # Unit and integration tests

Research Context

Spaceborne edge computing enables AI-capable CubeSats to process data onboard, reduce downlink pressure, and operate with greater autonomy. These systems face strict memory, power, and latency constraints, so model design must account for both predictive performance and deployment cost.

PyNAS explores evolutionary Neural Architecture Search for this setting. The framework is designed around compact segmentation architectures and hardware-aware optimization for CubeSat-class platforms such as NVIDIA Jetson AGX Orin and Intel Movidius Myriad X targets.

Documentation

Citation

If you use PyNAS in academic work, cite the Zenodo record below. A paper-specific citation will be added when the associated manuscript is available.

@software{pynas_zenodo_15332053,
  title = {PyNAS},
  publisher = {Zenodo},
  doi = {10.5281/zenodo.15332053},
  url = {https://doi.org/10.5281/zenodo.15332053}
}

Authors

Little Place Lab logo

License

This project is licensed under the Apache License 2.0. See LICENSE for the full license text.

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

esa_pynas-0.1.0.tar.gz (48.7 kB view details)

Uploaded Source

Built Distribution

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

esa_pynas-0.1.0-py3-none-any.whl (51.4 kB view details)

Uploaded Python 3

File details

Details for the file esa_pynas-0.1.0.tar.gz.

File metadata

  • Download URL: esa_pynas-0.1.0.tar.gz
  • Upload date:
  • Size: 48.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.9

File hashes

Hashes for esa_pynas-0.1.0.tar.gz
Algorithm Hash digest
SHA256 30cab32a1713b79d3f743ab173cf1afd1466a6db862e150f0a1ba0c916644573
MD5 a08ace04eb478a97675540b78f2c591b
BLAKE2b-256 dcf9930baa3c566971a98d867c78b9235612c25d0174dac1ff5dd0e3b9d49c47

See more details on using hashes here.

File details

Details for the file esa_pynas-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: esa_pynas-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 51.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.9

File hashes

Hashes for esa_pynas-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 94b9fd8404d8d529c9a0f60db9f93d3e0e85d2a8bb8a23d2a0b779f6b81b48d6
MD5 d63bf4df2b6e8a6ac3e6e60518025dda
BLAKE2b-256 768c6ff8fbc3f7a829998f7859d24ec50c6bc1df6bde015efcd4a2215ba60196

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