MCPcopy Create free account
hub / github.com/LeCAR-Lab/model-based-diffusion / objective_function

Function objective_function

mbd/notebooks/01_1d_demo.py:27–43  ·  view source on GitHub ↗

Define the objective function J(x) with multiple local minima. Args: x: Input values Returns: Objective function values

(x)

Source from the content-addressed store, hash-verified

25
26# %%
27def objective_function(x):
28 """
29 Define the objective function J(x) with multiple local minima.
30
31 Args:
32 x: Input values
33
34 Returns:
35 Objective function values
36 """
37 # Main objective component (double-well potential)
38 y = 1.0 * ((x**4 - 0.5) ** 2)
39
40 # Add sinusoidal perturbation for multiple local minima
41 y = y + np.sin(2 * np.pi * 10.0 * x) * 0.04
42
43 return y
44
45
46# %% [markdown]

Callers 1

01_1d_demo.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected