Skip to main content

Algorithms for inverse design

Project description

invrs-opt - Optimization algorithms for inverse design

v0.5.1

Overview

The invrs-opt package defines an optimizer API intended for topology optimization, inverse design, or AI-guided design. It (currently) implements the L-BFGS-B optimization algorithm along with some variants. The API is intended to be general so that new algorithms can be accommodated, and is inspired by the functional optimizer approach used in jax. Example usage is as follows:

initial_params = ...

optimizer = invrs_opt.lbfgsb()
state = optimizer.init(initial_params)

for _ in range(steps):
    params = optimizer.params(state)
    value, grad = jax.value_and_grad(loss_fn)(params)
    state = optimizer.update(grad=grad, value=value, params=params, state=state)

Optimizers in invrs-opt are compatible with custom types defined in the totypes package. The basic lbfgsb optimizer enforces bounds for custom types, while the density_lbfgsb optimizer implements a filter-and-threshold operation for DensityArray2D types to ensure that solutions have the correct length scale.

Install

pip install invrs_opt

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

invrs_opt-0.5.1.tar.gz (16.4 kB view details)

Uploaded Source

Built Distribution

invrs_opt-0.5.1-py3-none-any.whl (15.9 kB view details)

Uploaded Python 3

File details

Details for the file invrs_opt-0.5.1.tar.gz.

File metadata

  • Download URL: invrs_opt-0.5.1.tar.gz
  • Upload date:
  • Size: 16.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.2

File hashes

Hashes for invrs_opt-0.5.1.tar.gz
Algorithm Hash digest
SHA256 1dd4257eaff4ab55ecb4f9cd57fa0e78341d3705644a30200d52ded51d69e64f
MD5 4d3c6b2b21aa1fc2423b62e5bf6244f1
BLAKE2b-256 3b84c3db06fbf437d28b0da5438f7b6f59c7145401d4de63d952ad97a89d3a51

See more details on using hashes here.

File details

Details for the file invrs_opt-0.5.1-py3-none-any.whl.

File metadata

  • Download URL: invrs_opt-0.5.1-py3-none-any.whl
  • Upload date:
  • Size: 15.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.2

File hashes

Hashes for invrs_opt-0.5.1-py3-none-any.whl
Algorithm Hash digest
SHA256 840d8729731828bfd7bb8d4b3ca768dfe5229c8f9845c3e3d64afc2bb984cdf3
MD5 b7c8188466d5e4270a2fcb2a14c2a167
BLAKE2b-256 643bedc7f115bec0d5f42adddaaefb6dbe0becf2a710f8d0349fa9800b636779

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page