Skip to main content

A neural adjoint method implementation

Project description

MM-Neural-Adjoint

A Python package implementing neural adjoint methods, specifically designed for predicting the geometries of metamaterials. This implementation is based on the work from BDIMNNA (Benchmarking Deep Inverse Models over time, and the Neural-Adjoint method), published in NeurIPS 2020 by Simiao Ren, Willie J. Padilla and Jordan Malof.

About

This package focuses on the Neural Adjoint (NA) method for inverse design of metamaterials. It provides a streamlined implementation specifically optimized for metamaterial geometry prediction tasks, building upon the benchmarking work done in the original BDIMNNA repository.

Installation

This package supports different hardware configurations including CPU, Apple Silicon (M1/M2), and NVIDIA GPUs. Choose the appropriate installation method based on your hardware:

Basic Installation (CPU/Apple Silicon)

pip install -e .

For NVIDIA GPU Users

If you have an NVIDIA GPU, you can install with CUDA support:

# For CUDA 11.8
pip install -e .[cuda]

# For CUDA 12.1
pip install -e .[cuda12]

Development Installation

For contributors and developers:

# Clone the repository
git clone https://github.com/yourusername/MM-Neural-Adjoint.git
cd MM-Neural-Adjoint

# Install in editable mode with all dependencies
pip install -e .

Hardware Support

  • CPU: Supported on all platforms
  • Apple Silicon (M1/M2): GPU acceleration via MPS backend (included in default installation)
  • NVIDIA GPUs: CUDA support available through specific installation options

Usage

After installation, you can import and use the package in your Python code:

import mm_neural_adjoint

Examples

The package includes several example notebooks and scripts to help you get started with metamaterial design using the Neural Adjoint method. You can find these in the examples/ directory:

  • examples/example1.ipynb: Introduction to basic package functionality

To run the examples:

cd examples
jupyter notebook

## Requirements

- Python >= 3.7
- PyTorch >= 2.6.0
- NumPy >= 2.2.4
- Pandas >= 2.2.3
- tqdm >= 4.67.1
- MLflow >= 2.21.3
- scikit-learn >= 1.4.0

## Acknowledgments

This package is based on the Neural Adjoint implementation from the [BDIMNNA repository](https://github.com/BensonRen/BDIMNNA) by Benson Ren et al. We thank the original authors for their foundational work in developing and benchmarking the Neural Adjoint method.

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

mm_neural_adjoint-0.1.10.tar.gz (12.0 MB view details)

Uploaded Source

Built Distribution

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

mm_neural_adjoint-0.1.10-py2.py3-none-any.whl (3.4 kB view details)

Uploaded Python 2Python 3

File details

Details for the file mm_neural_adjoint-0.1.10.tar.gz.

File metadata

  • Download URL: mm_neural_adjoint-0.1.10.tar.gz
  • Upload date:
  • Size: 12.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.7

File hashes

Hashes for mm_neural_adjoint-0.1.10.tar.gz
Algorithm Hash digest
SHA256 35e7fb3bfa839bfd6eee2859c8a439ac40f2f5b688d4888b48fc689601ed634e
MD5 b4f3836a294d101ba9e88d044d5d168e
BLAKE2b-256 ed5aad1d45479388f263daed8bc2bf96233b26ee6e17cb9e6aefca54f18a8f5e

See more details on using hashes here.

File details

Details for the file mm_neural_adjoint-0.1.10-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for mm_neural_adjoint-0.1.10-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 b21f9b913be7529294435a2cd7199c5b547c2f90dc45a0609bef08d8a6d10978
MD5 87566af56d775a850a1d3fab71e41fc6
BLAKE2b-256 cd8f6c34dbdcc7dd1e1eb7da822e4ab4fe55b03a6ea7adba6cccb676b52fea91

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