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.1.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.1-py3-none-any.whl (51.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: esa_pynas-0.1.1.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.1.tar.gz
Algorithm Hash digest
SHA256 f6486cd65adcbab0f8ed4d4e82703c8c1e4b7d72d1ae42ca557c309191eefa25
MD5 4f6c32714ee883e5b5678b0a66e3ffb4
BLAKE2b-256 e85d4f8cb67ab268d41c12ff62520c3f7fa171c2e7b900e69cb3a30338b6f8a2

See more details on using hashes here.

File details

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

File metadata

  • Download URL: esa_pynas-0.1.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c681447adc0b3951019bf472f37b9208d91c42e09c707c068e2bc8346833de76
MD5 2f9391e6d3c506a25536315da3d4cf04
BLAKE2b-256 a6ef48265d67b4a4b60e65536bfe38b36aa6988c7786df9573dd2a2fec7a1847

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