SciPy generators
xopt.generators.sequential.neldermead.NelderMeadGenerator ¶
NelderMeadGenerator(**kwargs)
Bases: SequentialGenerator
Nelder-Mead algorithm from SciPy in Xopt's Generator form. Converted to use a state machine to resume in exactly the last state.
Attributes:
Name | Type | Description |
---|---|---|
name |
str
|
The name of the generator. |
initial_point |
Optional[Dict[str, float]]
|
Initial point for the optimization. |
initial_simplex |
Optional[Dict[str, Union[List[float], ndarray]]]
|
Initial simplex for the optimization. |
adaptive |
bool
|
Change hyperparameters based on dimensionality. |
current_state |
SimplexState
|
Current state of the simplex. |
future_state |
Optional[SimplexState]
|
Future state of the simplex. |
x |
Optional[ndarray]
|
Current x value. |
y |
Optional[float]
|
Current y value. |
Methods:
Name | Description |
---|---|
add_data |
Add new data to the generator. |
generate |
Generate a specified number of candidate samples. |
_call_algorithm |
Call the Nelder-Mead algorithm. |
simplex |
Returns the simplex in the current state. |
Source code in xopt/generators/sequential/neldermead.py
126 127 128 129 130 131 132 133 134 135 136 137 138 |
|
Attributes¶
xopt.generators.sequential.neldermead.NelderMeadGenerator.simplex
property
¶
simplex
Returns the simplex in the current state.
Returns:
Type | Description |
---|---|
Dict[str, ndarray]
|
The simplex in the current state. |
xopt.generators.sequential.neldermead.NelderMeadGenerator.x0
property
¶
x0
Raw internal initial point for convenience. If initial_point is set, it will be used. Otherwise, if data is set, the last point will be used.
Returns:
Type | Description |
---|---|
ndarray
|
The initial point as a NumPy array. |
xopt.generators.sequential.rcds.RCDSGenerator ¶
RCDSGenerator(**kwargs)
Bases: SequentialGenerator
RCDS algorithm.
Reference: An algorithm for online optimization of accelerators Huang, X., Corbett, J., Safranek, J. and Wu, J. doi: 10.1016/j.nima.2013.05.046
This algorithm must be stepped serially.
Attributes:
Name | Type | Description |
---|---|---|
name |
str
|
Name of the generator. |
x0 |
Optional[list]
|
Initial solution vector. |
init_mat |
Optional[ndarray]
|
Initial direction matrix. |
noise |
PositiveFloat
|
Estimated noise level. |
step |
PositiveFloat
|
Step size for the optimization. |
_ub |
ndarray
|
Upper bounds of the variables. |
_lb |
ndarray
|
Lower bounds of the variables. |
_powell |
PowellMainStateMachine
|
Instance of the PowellMainStateMachine. |
_sign |
int
|
Sign of the objective function (1 for MINIMIZE, -1 for MAXIMIZE). |
Source code in xopt/generator.py
102 103 104 105 106 107 108 |
|
xopt.generators.sequential.extremumseeking.ExtremumSeekingGenerator ¶
ExtremumSeekingGenerator(**kwargs)
Bases: SequentialGenerator
Extremum seeking algorithm.
Reference: Extremum Seeking-Based Control System for Particle Accelerator Beam Loss Minimization A. Scheinker, E. -C. Huang and C. Taylor doi: 10.1109/TCST.2021.3136133
This algorithm must be stepped serially.
Attributes:
Name | Type | Description |
---|---|---|
name |
str
|
The name of the generator. |
k |
PositiveFloat
|
Feedback gain. |
oscillation_size |
PositiveFloat
|
Oscillation size. |
decay_rate |
PositiveFloat
|
Decay rate. |
_nES |
int
|
Number of extremum seeking parameters. |
_wES |
ndarray
|
Frequencies for extremum seeking. |
_dtES |
float
|
Time step for extremum seeking. |
_aES |
ndarray
|
Amplitudes for extremum seeking. |
_p_ave |
ndarray
|
Average of parameter bounds. |
_p_diff |
ndarray
|
Difference of parameter bounds. |
_amplitude |
float
|
Amplitude of oscillation. |
_i |
int
|
Evaluation counter. |
_last_input |
ndarray
|
Last input values. |
_last_outcome |
float
|
Last outcome value. |
Methods:
Name | Description |
---|---|
add_data |
Add new data to the generator. |
p_normalize |
Normalize parameters. |
p_un_normalize |
Un-normalize parameters. |
generate |
Generate a specified number of candidate samples. |
Source code in xopt/generators/sequential/extremumseeking.py
82 83 84 85 86 87 88 89 90 91 92 93 94 |
|
Functions¶
xopt.generators.sequential.extremumseeking.ExtremumSeekingGenerator.p_normalize ¶
p_normalize(p)
Normalize parameters.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
p
|
ndarray
|
The parameters to normalize. |
required |
Returns:
Type | Description |
---|---|
ndarray
|
The normalized parameters. |
Source code in xopt/generators/sequential/extremumseeking.py
118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 |
|
xopt.generators.sequential.extremumseeking.ExtremumSeekingGenerator.p_un_normalize ¶
p_un_normalize(p)
Un-normalize parameters.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
p
|
ndarray
|
The parameters to un-normalize. |
required |
Returns:
Type | Description |
---|---|
ndarray
|
The un-normalized parameters. |
Source code in xopt/generators/sequential/extremumseeking.py
135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 |
|