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.
Reference¶
- Hitz et al., 2017. Adaptive Continuous-Space Informative Path Planning for Online Environmental Monitoring.
Attributes¶
objective:
Objective object to evaluate information gain.
transform:
Optional transform applied to candidate solutions (e.g., for IPP / FoV).
X_init:
Flattened initial guess of the sensing locations.
pbounds:
Convex hull of the X_objective points, used as an implicit geometric
bound (not enforced directly by CMA-ES).
Source code in sgptools/methods.py
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 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 | |
__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¶
num_sensing:
Number of sensing locations per robot.
X_objective:
Array of shape (n, d) used to define the GP objective and
to build the convex hull bounds.
kernel:
GPflow kernel used inside the objective.
noise_variance:
Observation noise variance used inside the objective.
transform:
Optional transform applied to candidate solutions before objective
evaluation and constraints.
num_robots:
Number of robots / agents. Defaults to 1.
X_candidates:
Optional discrete candidate set of locations with shape (c, d).
If provided, continuous solutions are snapped to candidates.
num_dim:
Dimensionality of sensing locations. If None, defaults to
X_objective.shape[-1], or to X_init.shape[-1] if X_init
is provided.
objective:
Objective specification, either a string key for
get_objective or a pre-instantiated Objective.
X_init:
Initial guess for the sensing locations, with shape
(num_sensing * num_robots, num_dim). If None, an initial set
is selected via get_inducing_pts.
**kwargs:
Extra 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
get_transform()
¶
Return a deep copy of the transform used by this method.
Returns¶
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¶
max_steps:
Maximum number of function evaluations (CMA-ES iterations). Defaults
to 500.
tol:
Function-value tolerance for termination (stopping criterion
passed to CMA). Defaults to 1e-6.
verbose:
If True, CMA-ES prints progress messages.
seed:
Optional random seed for reproducibility.
restarts:
Number of CMA-ES restarts allowed. Defaults to 5.
**kwargs:
Additional keyword arguments forwarded to cma.fmin2 (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.
Source code in sgptools/methods.py
update(kernel, noise_variance)
¶
Update the kernel and noise variance used by the objective.
Parameters¶
kernel: New GPflow kernel instance. noise_variance: New observation noise variance.