Skip to content

invrs-io/opt

This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Martin SchubertMartin Schubert
Martin Schubert
and
Martin Schubert
Jan 15, 2025
dff38e1 · Jan 15, 2025
Jan 15, 2025
Jan 15, 2025
Oct 20, 2024
Dec 18, 2024
Oct 25, 2023
Oct 25, 2023
Oct 25, 2023
Aug 12, 2024
Dec 18, 2024
Jan 15, 2025

Repository files navigation

invrs-opt - Optimization algorithms for inverse design

v0.10.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