BayesianOpt¶
sgptools.methods.BayesianOpt
¶
Bases: Method
Informative sensor placement / path optimization using Bayesian Optimization over a continuous search space.
A Bayesian optimization loop is run over a flattened vector containing all
sensing locations for all robots. At each iteration, the candidate
locations are reshaped, optionally transformed (for IPP / FoV modeling),
evaluated under a GP-based objective (e.g. mutual information), and
penalized by any constraints provided by the Transform.
References¶
- Vivaldini et al., 2019. UAV route planning for active disease classification.
- Francis et al., 2019. Occupancy map building through Bayesian exploration.
Attributes¶
objective:
Objective object encapsulating the GP-based information measure to
maximize.
transform:
Optional transform applied to candidate sensing locations before
evaluating the objective.
pbounds:
Dictionary mapping parameter names 'x0', 'x1', ... to their search
bounds (lower, upper), as required by bayes_opt.BayesianOptimization.
Source code in sgptools/methods.py
169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 | |
__init__(num_sensing, X_objective, kernel, noise_variance, transform=None, num_robots=1, X_candidates=None, num_dim=None, objective='SLogMI', **kwargs)
¶
Initialize a Bayesian optimization-based method.
Parameters¶
num_sensing:
Number of sensing locations per robot to optimize.
X_objective:
Array of shape (n, d) used to define the underlying objective.
The bounds of this set are used to define the BO search space.
kernel:
GPflow kernel used inside the objective.
noise_variance:
Observation noise variance used inside the objective.
transform:
Optional transform applied to the candidate solution before
evaluating the objective (and constraints). For example, an
IPPTransform.
num_robots:
Number of robots / agents. Defaults to 1.
X_candidates:
Optional discrete candidate set of locations with shape (c, d).
If provided, the final continuous solution is snapped to the
nearest candidate locations.
num_dim:
Dimensionality of the sensing locations. If None, defaults to
X_objective.shape[-1].
objective:
Objective specification. Either a string key understood by
get_objective (e.g. 'SLogMI', 'MI') or an already-instantiated
Objective object.
**kwargs:
Additional keyword arguments forwarded to the objective constructor
when objective is a string.
Source code in sgptools/methods.py
get_hyperparameters()
¶
Return the current kernel and noise variance used by the objective.
Returns¶
(gpflow.kernels.Kernel, float) A deep copy of the kernel and the current noise variance.
Source code in sgptools/methods.py
optimize(max_steps=50, init_points=10, verbose=False, seed=None, **kwargs)
¶
Run Bayesian optimization to obtain informative sensing locations.
Parameters¶
max_steps:
Number of Bayesian optimization iterations after the initial random
exploration. Defaults to 50.
init_points:
Number of purely random evaluations before BO starts. Defaults to 10.
verbose:
If True, print progress messages from BayesianOptimization.
seed:
Optional random seed to make BO reproducible.
**kwargs:
Extra keyword arguments forwarded to BayesianOptimization
(currently unused in this wrapper, but accepted for flexibility).
Returns¶
np.ndarray
Array of shape (num_robots, num_sensing, num_dim) containing the
optimized sensing locations in the original coordinate space.
Source code in sgptools/methods.py
update(kernel, noise_variance)
¶
Update the kernel and noise variance used by the underlying objective.
Parameters¶
kernel: New GPflow kernel instance. noise_variance: New observation noise variance.