GreedyObjective¶
sgptools.methods.GreedyObjective
¶
Bases: Method
Implements informative sensor placement/path optimization using a greedy approach based on a specified objective function.
This method iteratively selects the best sensing location from a set of candidates that maximizes the objective function. It currently supports only single-robot scenarios.
Refer to the following papers for more details
- Near-Optimal Sensor Placements in Gaussian Processes: Theory, Efficient Algorithms and Empirical Studies [Krause et al., 2008]
- Data-driven learning and planning for environmental sampling [Ma et al., 2018]
Attributes:
Name | Type | Description |
---|---|---|
objective |
object
|
The objective function to be maximized (e.g., Mutual Information). |
transform |
Optional[Transform]
|
Transform object applied to selected locations. |
Source code in sgptools/methods.py
651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 |
|
__init__(num_sensing, X_objective, kernel, noise_variance, transform=None, num_robots=1, X_candidates=None, num_dim=None, objective='SLogMI', **kwargs)
¶
Initializes the GreedyObjective optimizer.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
num_sensing
|
int
|
Number of sensing locations to select. |
required |
X_objective
|
ndarray
|
(n, d); Data points used to define the objective function. |
required |
kernel
|
Kernel
|
GPflow kernel function. |
required |
noise_variance
|
float
|
Data noise variance. |
required |
transform
|
Optional[Transform]
|
Transform object to apply to inducing points. Defaults to None. |
None
|
num_robots
|
int
|
Number of robots/agents. Defaults to 1. |
1
|
X_candidates
|
Optional[ndarray]
|
(c, d); Discrete set of candidate locations for sensor placement. If None, X_objective is used as candidates. |
None
|
num_dim
|
Optional[int]
|
Dimensionality of the sensing locations. Defaults to dimensonality of X_objective. |
None
|
objective
|
Union[str, Any]
|
The objective function to use. Can be a string ('SLogMI', 'MI') or an instance of an objective class. Defaults to 'SLogMI'. |
'SLogMI'
|
**kwargs
|
Any
|
Additional keyword arguments passed to the objective function. |
{}
|
Source code in sgptools/methods.py
get_hyperparameters()
¶
Retrieves the current kernel and noise variance hyperparameters from the objective.
Returns:
Type | Description |
---|---|
Tuple[Kernel, float]
|
Tuple[gpflow.kernels.Kernel, float]: A tuple containing a deep copy of the kernel and the noise variance. |
Source code in sgptools/methods.py
optimize(optimizer='naive', verbose=False, **kwargs)
¶
Optimizes sensor placement using a greedy approach.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
optimizer
|
str
|
The greedy optimizer strategy (e.g., 'naive', 'lazy'). Defaults to 'naive'. |
'naive'
|
verbose
|
bool
|
Verbosity, if True additional details will by reported. Defaults to False. |
False
|
**kwargs
|
Any
|
Additional keyword arguments. |
{}
|
Returns:
Type | Description |
---|---|
ndarray
|
np.ndarray: (num_robots, num_sensing, num_dim); Optimized sensing locations. |
Usage
Source code in sgptools/methods.py
update(kernel, noise_variance)
¶
Updates the kernel and noise variance parameters of the objective function.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
kernel
|
Kernel
|
Updated GPflow kernel function. |
required |
noise_variance
|
float
|
Updated data noise variance. |
required |