Base¶
sgptools.methods.get_method(method)
¶
Retrieves an optimization method class by its string name.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
method
|
str
|
The name of the optimization method (e.g., 'ContinuousSGP', 'CMA'). |
required |
Returns:
Type | Description |
---|---|
Type[Method]
|
Type[Method]: The class of the requested optimization method. |
Raises:
Type | Description |
---|---|
KeyError
|
If the method name is not found. |
Usage
Source code in sgptools/methods.py
sgptools.methods.Method
¶
Method class for optimization methods.
Attributes:
Name | Type | Description |
---|---|---|
num_sensing |
int
|
Number of sensing locations to optimize. |
num_dim |
int
|
Dimensionality of the data points. |
num_robots |
int
|
Number of robots/agents. |
X_objective |
ndarray
|
(n, d); Data points used to define the objective function. |
kernel |
Kernel
|
GPflow kernel function. |
noise_variance |
float
|
Data noise variance. |
transform |
Optional[Transform]
|
Transform object to apply to inducing points. |
X_candidates |
Optional[ndarray]
|
(c, d); Discrete set of candidate locations for sensor placement. |
num_dim |
int
|
Dimensionality of the sensing locations. |
Source code in sgptools/methods.py
__init__(num_sensing, X_objective, kernel, noise_variance, transform=None, num_robots=1, X_candidates=None, num_dim=None, **kwargs)
¶
Initializes the Method class.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
num_sensing
|
int
|
Number of sensing locations to optimize. |
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. Defaults to None. |
None
|
num_dim
|
Optional[int]
|
Dimensionality of the sensing locations. Defaults to dimensonality of X_objective. |
None
|
**kwargs
|
Any
|
Additional keyword arguments. |
{}
|
Source code in sgptools/methods.py
get_hyperparameters()
¶
Retrieves the current kernel and noise variance hyperparameters.
Raises:
Type | Description |
---|---|
NotImplementedError
|
This method must be implemented by subclasses. |
Returns:
Type | Description |
---|---|
Tuple[Kernel, float]
|
Tuple[gpflow.kernels.Kernel, float]: A tuple containing the kernel and noise variance. |
Source code in sgptools/methods.py
optimize()
¶
Optimizes the sensor placements/path(s).
Raises:
Type | Description |
---|---|
NotImplementedError
|
This method must be implemented by subclasses. |
Returns:
Type | Description |
---|---|
ndarray
|
np.ndarray: (num_robots, num_sensing, num_dim); Optimized sensing locations. |
Source code in sgptools/methods.py
update(kernel, noise_variance)
¶
Updates the kernel and noise variance parameters of the underlying model/objective.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
kernel
|
Kernel
|
Updated GPflow kernel function. |
required |
noise_variance
|
float
|
Updated data noise variance. |
required |
Raises:
Type | Description |
---|---|
NotImplementedError
|
This method must be implemented by subclasses. |