Transformations
sgptools.models.core.transformations
Provides transforms to model complex sensor field of views and handle informative path planning
IPPTransform
Bases: Transform
Transform to model IPP problems
Usage details
- For point sensing, set
sampling_rate = 2
- For continuous sensing, set
sampling_rate > 2
(account for the information along the path) - For continuous sensing with aggregation, set
sampling_rate > 2
andaggregate_fov = True
(faster but solution quality is a bit diminished) - If using a non-point FoV model with continuous sampling, only the FoV inducing points are aggregated
- For multi-robot case, set
num_robots > 1
- For onlineIPP use
update_fixed
to freeze the visited waypoints
Parameters:
Name | Type | Description | Default |
---|---|---|---|
sampling_rate |
int
|
Number of points to sample between each pair of inducing points |
2
|
distance_budget |
float
|
Distance budget for the path |
None
|
num_robots |
int
|
Number of robots |
1
|
Xu_fixed |
ndarray
|
(num_robots, num_visited, num_dim); Visited waypoints that don't need to be optimized |
None
|
num_dim |
int
|
Number of dimensions of the inducing points |
2
|
sensor_model |
Transform
|
Transform object to expand each inducing point to |
None
|
aggregate_fov |
bool
|
Used only when sampling_rate > 2, i.e., when using a continuous sensing model.
If |
False
|
Source code in sgptools/models/core/transformations.py
94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 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 |
|
aggregate(k)
Applies the aggregation transform to kernel matrices. Checks sensor_model
and uses the appropriate aggregation transform.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
k |
tensor
|
(mp, mp)/(mp, n); Kernel matrix.
|
required |
Returns:
Name | Type | Description |
---|---|---|
k |
tensor
|
(m, m)/(m, n); Aggregated kernel matrix |
Source code in sgptools/models/core/transformations.py
constraints(Xu)
Computes the distance constraint term that is added to the SGP's optimization function. Each robot can be assigned a different distance budget.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
Xu |
ndarray
|
Inducing points from which to compute the distance constraints |
required |
Returns:
Name | Type | Description |
---|---|---|
loss |
float
|
distance constraint term |
Source code in sgptools/models/core/transformations.py
distance(Xu)
Computes the distance incured by sequentially visiting the inducing points
Args:
Xu (ndarray): (m, num_dim); Inducing points from which to compute the path lengths
m
is the number of inducing points
num_dim
dimension of the data collection environment
Returns:
dist (float or tensor of floats): path length(s)
Source code in sgptools/models/core/transformations.py
expand(Xu, expand_sensor_model=True)
Sample points between each pair of inducing points to form the path
Parameters:
Name | Type | Description | Default |
---|---|---|---|
Xu |
ndarray
|
(num_robots x num_inducing, num_dim); Inducing points in the num_dim dimensional space |
required |
expand_sensor_model |
bool
|
Only add the fixed inducing points without other sensor/path transforms, used for online IPP |
True
|
Returns:
Name | Type | Description |
---|---|---|
Xu |
ndarray
|
Expansion transformed inducing points |
Source code in sgptools/models/core/transformations.py
update_Xu_fixed(Xu_fixed)
Function to update the visited waypoints
Parameters:
Name | Type | Description | Default |
---|---|---|---|
Xu_fixed |
ndarray
|
numpy array (num_robots, num_visited_waypoints, num_dim) |
required |
Source code in sgptools/models/core/transformations.py
SquareHeightTransform
Bases: Transform
Non-point Transform to model a height-dependent square FoV
Parameters:
Name | Type | Description | Default |
---|---|---|---|
num_side |
int
|
Number of points along each side of the FoV |
required |
aggregate_fov |
bool
|
If |
False
|
Source code in sgptools/models/core/transformations.py
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 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 |
|
distance(Xu)
Computes the distance incured by sequentially visiting the inducing points
Args:
Xu (ndarray): (m, 3); Inducing points from which to compute the path lengths.
m
is the number of inducing points.
Returns:
Name | Type | Description |
---|---|---|
dist |
float
|
path lengths |
Source code in sgptools/models/core/transformations.py
enable_aggregation(size=None)
Enable FoV covariance aggregation, which reduces the covariance matrix inversion cost by reducing the covariance matrix size.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
size |
int
|
If None, all the interpolated inducing points within the FoV are aggregated. Alternatively, the number of inducing points to aggregate can be explicitly defined using this variable. |
None
|
Source code in sgptools/models/core/transformations.py
expand(Xu)
Applies the expansion transform to the inducing points
Parameters:
Name | Type | Description | Default |
---|---|---|---|
Xu |
ndarray
|
(m, 3); Inducing points in the 3D position space.
|
required |
Returns:
Name | Type | Description |
---|---|---|
Xu |
ndarray
|
(mp, 2); Inducing points in input space.
|
Source code in sgptools/models/core/transformations.py
SquareTransform
Bases: Transform
Non-point Transform to model a square FoV. Only works for single robot cases.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
length |
float
|
Length of the square FoV |
required |
num_side |
int
|
Number of points along each side of the FoV |
required |
aggregate_fov |
bool
|
If |
False
|
Source code in sgptools/models/core/transformations.py
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 |
|
distance(Xu)
Computes the distance incured by sequentially visiting the inducing points
Args:
Xu (ndarray): (m, 3); Inducing points from which to compute the path lengths.
m
is the number of inducing points.
Returns:
Name | Type | Description |
---|---|---|
dist |
float
|
path lengths |
Source code in sgptools/models/core/transformations.py
enable_aggregation(size=None)
Enable FoV covariance aggregation, which reduces the covariance matrix inversion cost by reducing the covariance matrix size.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
size |
int
|
If None, all the interpolated inducing points within the FoV are aggregated. Alternatively, the number of inducing points to aggregate can be explicitly defined using this variable. |
None
|
Source code in sgptools/models/core/transformations.py
expand(Xu)
Applies the expansion transformation to the inducing points
Parameters:
Name | Type | Description | Default |
---|---|---|---|
Xu |
ndarray
|
(m, 3); Inducing points in the position and orientation space.
|
required |
Returns:
Name | Type | Description |
---|---|---|
Xu |
ndarray
|
(mp, 2); Inducing points in input space.
|
Source code in sgptools/models/core/transformations.py
Transform
Base class for transformations of the inducing points, including expansion and aggregation transforms.
Refer to the following papers for more details
- Efficient Sensor Placement from Regression with Sparse Gaussian Processes in Continuous and Discrete Spaces [Jakkala and Akella, 2023]
- Multi-Robot Informative Path Planning from Regression with Sparse Gaussian Processes [Jakkala and Akella, 2024]
Parameters:
Name | Type | Description | Default |
---|---|---|---|
aggregation_size |
int
|
Number of consecutive inducing points to aggregate |
None
|
constraint_weight |
float
|
Weight term that controls the importance of the constraint terms in the SGP's optimization objective |
1.0
|
Source code in sgptools/models/core/transformations.py
aggregate(k)
Applies the aggregation transform to kernel matrices
Parameters:
Name | Type | Description | Default |
---|---|---|---|
k |
tensor
|
(mp, mp)/(mp, n); Kernel matrix.
|
required |
Returns:
Name | Type | Description |
---|---|---|
k |
tensor
|
(m, m)/(m, n); Aggregated kernel matrix |
Source code in sgptools/models/core/transformations.py
constraints(Xu)
Computes the constraint terms that are added to the SGP's optimization function
Parameters:
Name | Type | Description | Default |
---|---|---|---|
Xu |
ndarray
|
Inducing points from which to compute the constraints |
required |
Returns:
Name | Type | Description |
---|---|---|
c |
float
|
constraint terms (eg., distance constraint) |
Source code in sgptools/models/core/transformations.py
expand(Xu)
Applies the expansion transform to the inducing points
Parameters:
Name | Type | Description | Default |
---|---|---|---|
Xu |
ndarray
|
Expansion transformed inducing points |
required |