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.3.tar.gz (49.8 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.3-py3-none-any.whl (51.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: esa_pynas-0.1.3.tar.gz
  • Upload date:
  • Size: 49.8 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.3.tar.gz
Algorithm Hash digest
SHA256 630204b130baebc2f0ee9611832dace22839fbb218872b71caaf072d45be8208
MD5 9696547baec55cb6d2ea0163dde59f1a
BLAKE2b-256 69bad545ad363b78c2be5cb9fe8a9b81bc26fa6a7c8400a479c48a9bc957ec6e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: esa_pynas-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 51.9 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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 10ff5ac72bb57eb19efb14d4823ccb2991ca1dc60a62d3ee38334740409a52e2
MD5 5015c674a6f48c012682646b8368e057
BLAKE2b-256 9c370877da535c6fda38847c08f523905155b7083a0274db94c63748166c0791

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