当前位置:网站首页>Isam2 operation process
Isam2 operation process
2022-07-06 06:12:00 【Zhan Miao】
1. Algorithm flow
2. update Function running process
- updateDelta: Update delta if we need it to check relinearization later
- update.pushBackFactors: Add any new factors
- For every new factor Generate an index , Put new factor Load nonlinearFactors in
- Remove what needs to be removed factor from nonlinearFactors and linearFactors Remove at the same time , Take from nonlinearFactors Removed from factor move removedFactors
- Remove removed factors from the variable index so we do not attempt to relinearize them
- computeUnusedKeys: Calculation is useless key
Get keys from removed factors and new factors, and compute unused keys, i.e., keys that are empty now and do not appear in the new factors.
- Statistics are associated with removed factors key, If this key Does not exist in member variables variableIndex_ in , Then write it down . Why does it not exist in variableIndex_ in ?
- Statistics of new factor relationships key
- The set obtained in the first step is different from the set obtained in the second step , It's useless key Set , Write it down as unusedKeys
- addVariables: Initialize any new variables
- Put the new variable into the member variable theta_ in , Initialize to 0
- stay detail Mark which variables are new
- update.error: Calculate nonlinear error
- gatherInvolvedKeys: Collect relevant information key
- Collect new factors related to removed factors key
- Collect the factors that need to be re linearized
- Also, keys that were not observed in existing factors, but whose affected keys have been extended now (e.g. smart factors)
- Put these key Back together , As related key, Write it down as markedKeys
- updateKeys:
- Traverse markedKeys
- stay detail Zhongba correlation key Marked as isObserved
- If relevant key There is no in unusedKeys in , That is to say, it is not useless key, Then copy it to the observed key in , Write it down as observedKeys
- Collect variables that need to be re linearized
- gatherRelinearizeKeys: Mark variables whose change is greater than the threshold , Write it down as relinKeys
- stay detail Mark them as isAboveRelinThreshold and isRelinearized
- update.findFluid: Mark cliques that involve marked variables and ancestors.
- From member variable roots_ Recursively find , Its element is a group
- Does the separator contain any of the relinKeys?
- If it is true then add this clique to markedKeys
- stay detail Mark in
- UpdateImpl::ExpmapMasked: Update linearization point for marked variables
- update.linearizeNewFactors: Linearize new factors
- update.augmentVariableIndex:
- Augment the variable index with the new factors
- Augment it with existing factors which now affect to more variables
- Recalculate: Redo top of Bayes tree and update data structures
- removeTop: Remove top of Bayes tree and convert to a factor graph: (a) For each affected variable, remove the corresponding clique and all parents up to the root. (b) Store orphaned sub-trees of removed cliques to variable orphans. about markedKeys Each of them key, If it exists in the member variable nodes_ in , Then the node is removed from the Bayesian tree , Deposit into Bayesian Network affectedBayesNet in , The orphans are placed in orphans in
- Put Bayesian Network affectedBayesNet All in key Deposit in affectedKeys in
- recalculateBatch: Do a batch step - reorder and relinearize all variables
- recalculateIncremental: Incremental updating , For the first time update Just use incremental update
- stay detail Mark the root group variable in
- hold affectedKeysSet Medium key Deposit in deltaReplacedMask_ in
- removeVariables: Remove unused variables , All exist in unusedKeys The variables in are all from delta_, theta_ And other member variables
- update.error: Calculate nonlinear error Do it again
3. recalculateIncremental Function running process
- Add the new factors into the resulting factor graph
- hold affectedKeys and observedKeys Load affectedAndNewKeys in
- relinearizeAffectedFactors: according to affectedAndNewKeys Yes nonlinearFactors_ Re linearize the corresponding factor in , Returns the linearized linear factor , Deposit in factors in
- detail The corresponding variable in is marked isReeliminated
- GetCachedBoundaryFactors: Add the cached intermediate results from the boundary of the orphans, Deposit in factors in
- Add the orphaned subtrees Why add it twice ?
- hold markedKeys Medium key and affectedKeys Medium key Put in affectedKeysSet in
- Use factor graph factors initialization VariableIndex Type variable affectedFactorsVarIndex
- Re-order and eliminate the factor graph into a Bayes net (Algorithm [alg:eliminate]), and re-assemble into a new Bayes tree (Algorithm [alg:BayesTree])
- create a partial reordering for the new and contaminated factors result->markedKeys are passed in: those variables will be forced to the end in the ordering, Create ordering constraints,constraintGroups namely updateParams.constrainedKeys
- Remove unaffected keys from the constraints, If a key Exist in unusedKeys in , That is, it is not used , Or it doesn't exist affectedKeysSet in , That is, it is not affected , Then take it from constraintGroups Delete in , That is, do not participate in reordering
- Ordering::ColamdConstrained Yes affectedFactorsVarIndex basis constraintGroups Reorder
- Do elimination
- Construct Gaussian elimination GaussianEliminationTree
- Build a union tree ISAM2JunctionTree
- Union tree elimination , Call the corresponding elimination function according to the parameters , Bayes tree and residual factor graph are obtained by elimination
- Put the root of Bayesian tree into member variable roots_ in , Put the node into the member variable nodes_ in
4. EliminatableClusterTree::eliminate Function running process
- structure EliminationData::EliminationPostOrderVisitor class , This constructor is also relatively simple , Is to initialize member variables with formal parameters
- function treeTraversal::DepthFirstForest function , Depth first search
- This function does not change the first argument passed *this Any content of
- use EliminatableClusterTree All root group structures of TraversalNode object , And put them on the stack in turn , these TraversalNode The parent nodes of objects are EliminationData
- Constantly take elements from the top of the stack , Until the stack is empty
- Collect all the root nodes , Put in result->roots_ in
- Put all the remaining Gather up
- The two make up pair, return
5. recalculateBatch Function running process
6. marginalizeLeaves Function running process
This function is not well written , A function has too many lines ;
Functions first define variables , Initialize variable , Define a lambda Expressions and other simple work , Then start the formal work
- Definition trackingRemoveSubtree, This is a lambda expression , For later use
- Input as root group subtreeRoot, Output as removed clique removedCliques
- call BayesTree::removeSubtree Function subtreeRoot And their descendants from nodes_ Remove
- Yes leafKeys Each of them key, If it already exists in leafKeysRemoved It's in , Indicates that it has been processed , Then skip , They haven't been dealt with , Before proceeding to the next step
- adopt nodes_ To find the key Corresponding clique
- Keep looking clique Parent node ( There are relatively difficult judgment conditions ) And assign the parent node to clique, This judgment condition needs to be further understood , Why only use the first in the Group key To judge
- If clique Of frontals() All in leafKeys in , Then it is marked as deleting the whole group
- If it is marked to delete the whole group , Call trackingRemoveSubtree Delete cliquee And their descendants , And store the marginalization factor into marginalFactors in
- If it is not marked to delete the whole group , To be added
- At this point we have updated the BayesTree, now update the remaining iSAM2 data structures
- Put the factors generated by marginalization into nonlinearFactors_,linearFactors_ and variableIndex_ in
- variableIndex_,delta_,nodes_,theta_ Delete useless variables
边栏推荐
猜你喜欢
Request forwarding and redirection
How to use the container reflection method encapsulated by thinkphp5.1 in business code
Network protocol model
MySQL之基础知识
The difference and usage between continue and break
数据库-当前读与快照读
(中)苹果有开源,但又怎样呢?
【Postman】Collections-运行配置之导入数据文件
[postman] test script writing and assertion details
Fault, error, failure of functional safety
随机推荐
黑猫带你学UFS协议第18篇:UFS如何配置逻辑单元(LU Management)
properties文件
【C语言】qsort函数
Commodity price visualization
请求转发与重定向
Arrays and collections
Interface test: what are the components of the URL in fiddler
The ECU of 21 Audi q5l 45tfsi brushes is upgraded to master special adjustment, and the horsepower is safely and stably increased to 305 horsepower
[untitled]
对数据安全的思考(转载)
Buuctf-[[gwctf 2019] I have a database (xiaoyute detailed explanation)
测试周期被压缩?教你9个方法去应对
Significance of unit testing
SQLMAP使用教程(三)实战技巧二
ESP32 ESP-IDF看门狗TWDT
Understanding of processes and threads
Title 1093: character reverse order
异常检测方法总结
IP day 16 VLAN MPLS configuration
Huawei BFD configuration specification