#include <HybridSmoother.h>
Public Member Functions | |
std::pair< HybridGaussianFactorGraph, HybridBayesNet > | addConditionals (const HybridGaussianFactorGraph &graph, const HybridBayesNet &hybridBayesNet) const |
Add conditionals from previous timestep as part of liquefication. More... | |
HybridNonlinearFactorGraph | allFactors () const |
Return all the recorded nonlinear factors. More... | |
const DiscreteValues & | fixedValues () const |
Return fixed values: More... | |
HybridGaussianConditional::shared_ptr | gaussianMixture (size_t index) const |
Get the hybrid Gaussian conditional from the Bayes Net posterior at index . More... | |
Ordering | getOrdering (const HybridGaussianFactorGraph &factors, const KeySet &newFactorKeys) |
Get an elimination ordering which eliminates continuous and then discrete. More... | |
const HybridBayesNet & | hybridBayesNet () const |
Return the Bayes Net posterior. More... | |
HybridSmoother (const std::optional< double > marginalThreshold={}) | |
Constructor. More... | |
Values | linearizationPoint () const |
Return the current linearization point. More... | |
HybridValues | optimize () const |
Optimize the hybrid Bayes Net, taking into accound fixed values. More... | |
void | reInitialize (HybridBayesNet &&hybridBayesNet) |
void | reInitialize (HybridBayesNet &hybridBayesNet) |
void | relinearize () |
void | update (const HybridNonlinearFactorGraph &graph, const Values &initial, std::optional< size_t > maxNrLeaves={}, const std::optional< Ordering > givenOrdering={}) |
Private Member Functions | |
Ordering | maybeComputeOrdering (const HybridGaussianFactorGraph &updatedGraph, const std::optional< Ordering > givenOrdering) |
Helper to compute the ordering if ordering is not given. More... | |
void | removeFixedValues (const HybridGaussianFactorGraph &newFactors) |
Remove fixed discrete values for discrete keys introduced in newFactors . More... | |
Private Attributes | |
HybridNonlinearFactorGraph | allFactors_ |
DiscreteValues | fixedValues_ |
HybridBayesNet | hybridBayesNet_ |
Values | linearizationPoint_ |
std::optional< double > | marginalThreshold_ |
The threshold above which we make a decision about a mode. More... | |
Definition at line 28 of file HybridSmoother.h.
|
inline |
Constructor.
removeDeadModes | Flag indicating whether to remove dead modes. |
marginalThreshold | The threshold above which a mode gets assigned a value and is considered "dead". 0.99 is a good starting value. |
Definition at line 46 of file HybridSmoother.h.
std::pair< HybridGaussianFactorGraph, HybridBayesNet > gtsam::HybridSmoother::addConditionals | ( | const HybridGaussianFactorGraph & | graph, |
const HybridBayesNet & | hybridBayesNet | ||
) | const |
Add conditionals from previous timestep as part of liquefication.
graph | The new factor graph for the current time step. |
hybridBayesNet | The hybrid bayes net containing all conditionals so far. |
ordering | The elimination ordering. |
Definition at line 198 of file HybridSmoother.cpp.
HybridNonlinearFactorGraph gtsam::HybridSmoother::allFactors | ( | ) | const |
Return all the recorded nonlinear factors.
Definition at line 311 of file HybridSmoother.cpp.
|
inline |
Return fixed values:
Definition at line 50 of file HybridSmoother.h.
HybridGaussianConditional::shared_ptr gtsam::HybridSmoother::gaussianMixture | ( | size_t | index | ) | const |
Get the hybrid Gaussian conditional from the Bayes Net posterior at index
.
index | Indexing value. |
Definition at line 267 of file HybridSmoother.cpp.
Ordering gtsam::HybridSmoother::getOrdering | ( | const HybridGaussianFactorGraph & | factors, |
const KeySet & | newFactorKeys | ||
) |
Get an elimination ordering which eliminates continuous and then discrete.
Expects factors
to already have the necessary conditionals which were connected to the variables in the newly added factors. Those variables should be in newFactorKeys
.
factors | All the new factors and connected conditionals. |
newFactorKeys | The keys/variables in the newly added factors. |
Definition at line 38 of file HybridSmoother.cpp.
const HybridBayesNet & gtsam::HybridSmoother::hybridBayesNet | ( | ) | const |
Return the Bayes Net posterior.
Definition at line 273 of file HybridSmoother.cpp.
Values gtsam::HybridSmoother::linearizationPoint | ( | ) | const |
Return the current linearization point.
Definition at line 306 of file HybridSmoother.cpp.
|
private |
Helper to compute the ordering if ordering is not given.
Definition at line 65 of file HybridSmoother.cpp.
HybridValues gtsam::HybridSmoother::optimize | ( | ) | const |
Optimize the hybrid Bayes Net, taking into accound fixed values.
Definition at line 278 of file HybridSmoother.cpp.
void gtsam::HybridSmoother::reInitialize | ( | HybridBayesNet && | hybridBayesNet | ) |
Re-initialize the smoother from a new hybrid Bayes Net.
Definition at line 28 of file HybridSmoother.cpp.
void gtsam::HybridSmoother::reInitialize | ( | HybridBayesNet & | hybridBayesNet | ) |
Re-initialize the smoother from a new hybrid Bayes Net (non rvalue version).
Definition at line 33 of file HybridSmoother.cpp.
void gtsam::HybridSmoother::relinearize | ( | ) |
Relinearize the nonlinear factor graph with the latest linearization point.
Definition at line 295 of file HybridSmoother.cpp.
|
private |
Remove fixed discrete values for discrete keys introduced in newFactors
.
Definition at line 89 of file HybridSmoother.cpp.
void gtsam::HybridSmoother::update | ( | const HybridNonlinearFactorGraph & | graph, |
const Values & | initial, | ||
std::optional< size_t > | maxNrLeaves = {} , |
||
const std::optional< Ordering > | givenOrdering = {} |
||
) |
Given new factors, perform an incremental update. The relevant densities in the hybridBayesNet
will be added to the input graph (fragment), and then eliminated according to the ordering
presented. The remaining factor graph contains hybrid Gaussian factors that are not connected to the variables in the ordering, or a single discrete factor on all discrete keys, plus all discrete factors in the original graph.
graph | The new factors, should be linear only |
maxNrLeaves | The maximum number of leaves in the new discrete factor, if applicable |
givenOrdering | The (optional) ordering for elimination, only continuous variables are allowed |
Prune
Definition at line 99 of file HybridSmoother.cpp.
|
private |
Definition at line 30 of file HybridSmoother.h.
|
private |
Definition at line 36 of file HybridSmoother.h.
|
private |
Definition at line 33 of file HybridSmoother.h.
|
private |
Definition at line 31 of file HybridSmoother.h.
|
private |
The threshold above which we make a decision about a mode.
Definition at line 35 of file HybridSmoother.h.