CMA¶
sgptools.methods.CMA
¶
Bases: Method
Informative sensor placement / path optimization using CMA-ES (Covariance Matrix Adaptation Evolution Strategy).
CMA-ES is a derivative-free, population-based genetic optimizer well-suited for non-convex, non-smooth objectives. Here, it searches over the flattened vector of sensing locations / waypoints.
Refer to the following paper for more details
- Hitz et al., 2017. Adaptive Continuous-Space Informative Path Planning for Online Environmental Monitoring.
Attributes:
| Name | Type | Description |
|---|---|---|
objective |
Objective
|
Objective object to evaluate information gain. |
transform |
Transform | None
|
Optional transform applied to candidate solutions (e.g., for IPP / FoV). |
X_init |
ndarray
|
Flattened initial guess of the sensing locations. |
pbounds |
Polygon
|
Convex hull of the |
Source code in sgptools/methods.py
375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 | |
__init__(num_sensing, X_objective, kernel, noise_variance, transform=None, num_robots=1, X_candidates=None, num_dim=None, objective='SLogMI', X_init=None, **kwargs)
¶
Initialize a CMA-ES-based optimization method.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
num_sensing
|
int
|
Number of sensing locations per robot. |
required |
X_objective
|
ndarray
|
Array of shape |
required |
kernel
|
Kernel
|
GPflow kernel used inside the objective. |
required |
noise_variance
|
float
|
Observation noise variance used inside the objective. |
required |
transform
|
Transform | None
|
Optional transform applied to candidate solutions before objective evaluation and constraints. |
None
|
num_robots
|
int
|
Number of robots / agents. Defaults to 1. |
1
|
X_candidates
|
ndarray | None
|
Optional discrete candidate set of locations with shape |
None
|
num_dim
|
int | None
|
Dimensionality of sensing locations. If |
None
|
objective
|
str | Objective
|
Objective specification, either a string key for
|
'SLogMI'
|
X_init
|
ndarray | None
|
Initial guess for the sensing locations, with shape
|
None
|
**kwargs
|
Any
|
Extra keyword arguments forwarded to the objective constructor
when |
{}
|
Source code in sgptools/methods.py
get_hyperparameters()
¶
Return the current kernel and noise variance used by the objective.
Returns:
| Type | Description |
|---|---|
Tuple[Kernel, float]
|
Tuple[gpflow.kernels.Kernel, float]: A deep copy of the kernel and the current noise variance. |
Source code in sgptools/methods.py
get_transform()
¶
Return a deep copy of the transform used by this method.
Returns:
| Name | Type | Description |
|---|---|---|
Transform |
Transform
|
Deep copy of the current transform. |
optimize(max_steps=500, tol=1e-06, verbose=False, seed=None, restarts=5, **kwargs)
¶
Run CMA-ES to obtain informative sensing locations.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
max_steps
|
int
|
Maximum number of function evaluations (CMA-ES iterations). Defaults to 500. |
500
|
tol
|
float
|
Function-value tolerance for termination (stopping criterion
passed to CMA). Defaults to |
1e-06
|
verbose
|
bool
|
If |
False
|
seed
|
int | None
|
Optional random seed for reproducibility. |
None
|
restarts
|
int
|
Number of CMA-ES restarts allowed. Defaults to 5. |
5
|
**kwargs
|
Any
|
Additional keyword arguments forwarded to |
{}
|
Returns:
| Type | Description |
|---|---|
ndarray
|
np.ndarray:
Array of shape |
Source code in sgptools/methods.py
update(kernel, noise_variance)
¶
Update the kernel and noise variance used by the objective.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
kernel
|
Kernel
|
New GPflow kernel instance. |
required |
noise_variance
|
float
|
New observation noise variance. |
required |