Amplify-BBOptΒΆ
An extension library for performing Black-Box Optimization (BBO) using the features of the Amplify SDK.
Tip
Black-box optimization is an optimization technique for finding optimal parameters for problems where the mathematical expression of the objective function is unknown or too complex.
Amplify-BBOpt is effective for optimizing functions that cannot be expressed with the Amplify SDK, such as experiments and simulations. Specifically, it is used in the following use cases:
Optimizing building shapes and equipment placement to maximize HVAC performance, adjusting member placement and load conditions to minimize structural displacement, etc.
Optimizing the composition of synthetic materials to maximize a performance metric, maximizing production in chemical plants, etc.
Searching for stirring conditions to achieve more uniform substance concentration, optimizing shape parameters of fluidic devices, etc.
Searching for conditions to achieve a desired experimental result, etc.
Since you can use the Amplify SDKβs solver clients, API tokens, and constraint helper functions as-is, you can leverage your usual Amplify SDK development experience when working on black-box optimization.
from amplify import AmplifyAEClient, less_equal
from amplify_bbopt import KMTrainer, Optimizer, RealVariable, blackbox
# Define the function to optimize
@blackbox
def func(
x: float = RealVariable(bounds=(0, 2.5)),
y: float = RealVariable(bounds=(1.0, 5.0)),
) -> float: ...
# Configure the solver client
client = AmplifyAEClient()
client.token = "YOUR_TOKEN"
# Set constraints
constraints = less_equal(func.variables.x + func.variables.y, 5)
# Run optimization
optimizer = Optimizer(
blackbox=func,
trainer=KMTrainer(),
client=client,
constraints=constraints
)
optimizer.add_random_training_data(num_data=5)
optimizer.optimize(num_iterations=10)
For installation instructions and usage details, please refer to the link below.