Skip to main content

Algorithms for inverse design

Project description

invrs-opt - Optimization algorithms for inverse design

v0.9.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.9.1.tar.gz (46.2 kB view details)

Uploaded Source

Built Distribution

invrs_opt-0.9.1-py3-none-any.whl (49.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: invrs_opt-0.9.1.tar.gz
  • Upload date:
  • Size: 46.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.4

File hashes

Hashes for invrs_opt-0.9.1.tar.gz
Algorithm Hash digest
SHA256 99fe3cf16c24411c6e3197df0f8d62ffb8f64f7ae7efe2ac15fbed1a9ad860ca
MD5 8a3ae84d2781adad8f5ff54dfc1acbef
BLAKE2b-256 3c97cf07d082e87e443c50f82484a038a6cf164fea2c7f0236330c0686bb17fb

See more details on using hashes here.

File details

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

File metadata

  • Download URL: invrs_opt-0.9.1-py3-none-any.whl
  • Upload date:
  • Size: 49.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.4

File hashes

Hashes for invrs_opt-0.9.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7db1443a325305282447c3edef6674cf3f050d3e6849edd640eaa3f038ceeacb
MD5 5b1162811d23f091a27c01346166ae83
BLAKE2b-256 38a6a2855f8d7bc6ea4c50c184eb109b73e647b1e5fa0180eb4e21bf7d98eef4

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