= {k:gtsam.symbol('x',k) for k in [1,2,3]}
x = vv({x[1]: [66]})
vv66 assert isinstance(vv66, gtsam.VectorValues)
1)
test_eq(vv66.size(),1]),66) test_eq(vv66.at(x[
linear
Utilities for Linear Inference
This code is used in the gtsam_examples book.
Easy Creation of VectorValues
vv
vv (keys_vectors:Dict[int,numpy.ndarray])
Create a VectorValues from a dict
= vv({x[1]:[3],x[2]:[4]})
vv34 assert isinstance(vv34, gtsam.VectorValues)
2)
test_eq(vv34.size(),1]),[3])
test_eq(vv34.at(x[2]),[4]) test_eq(vv34.at(x[
An Image Denoising Gaussian MRF
This example is used in gtsam-examples to show of loopy belief propagation.
denoising_MRF
denoising_MRF (M:int, N:int, sigma=0.5, smoothness_sigma=0.5)
Create MxN MRF @returns graph and symbols used for rows.
= denoising_MRF(3, 4)
graph, row_symbols = {c:float(1-i) for i,c in enumerate(row_symbols)}
position_hints =True, hints=position_hints) show(graph, binary_edges
A 2D Points Gaussian MRF
We create a grid of 2D points, connected in a 4-neighborhood, to show off clustered loopy belief propagation.