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.11.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.11-py2.py3-none-any.whl (11.0 kB view details)

Uploaded Python 2Python 3

File details

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

File metadata

  • Download URL: mm_neural_adjoint-0.1.11.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.11.tar.gz
Algorithm Hash digest
SHA256 d78d8b5178508b3bb6c1342fd9114742d400d22bee3a85a8005e49af56cb0501
MD5 89bdad774ea2538501cddfb2eae4dbc5
BLAKE2b-256 a1d2232d8ac103ce81abebebafcc6b0a0e29041879bcf151135712fa60c5a6c3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mm_neural_adjoint-0.1.11-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 b1b7c2a10863e213f9aa93986cb6d2241878ffb9d693d212927fe9a0e962a216
MD5 83f802265d5bc420e4798491d29ead17
BLAKE2b-256 775167cb6c81228aac766f77469e180fee51c229dd2fa3ecdaf29a90658ea6a6

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