-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Decide if msg channels in BTND or edges only #675
Comments
I have a preference for storing message channels inside CSMCs rather than on tree edges, loosely discussed in #459. Main discussion transferred here from #532 :
That was a bit unclear sorry -- I'm thinking of the My thinking around messages in cliques or edges is inspired by this "clique in isolation" or "individual CSM steps" way of thinking. The knee jerk reaction is that a clique is a self contained unit with all necessary messages etc. -- if you have the clique at a particular point in time then (hopefully) everything else downstream becomes easier (maybe). My reservation surrounding messages on edges comes from now having to store/restore not just the clique, but also its edges. Furthermore, the edges must now be duplicated for this or that clique, and synchronization between two cliques becomes harder and harder to track. Hence the knee jerk. That said, there are limits to how "defensive" the coding patterns should be... A step-by-step CSM is/would be a great developer's helper, but not a replacement for end-to-end testing. Hence the relent to, just build it on edges and preemptively add NOTES as might seem relevant. There is a looming refactoring here on tree messages, as you already know. This refactoring has slipped into the new year and likely best suited to do part of the treeinit effort. I will likely have to punt the message refactoring another couple of weeks given my immediate schedule, but super excited to get that part cleaned up!
Agreed, that sounds like the right behaviour.
Agreed on Julia While building the treeinit code (as it stands now) I was forced to add additional |
functions like |
We should maybe make the distinction between the message channels and the messages itself. |
Ah, I had it that your preference was not in the tree, maybe make the tree read only? My preference currently is not to store this separately in the tree but rather in either cliques or csmc (#675 (comment))... let me chew on this a little more. Nonparametric is currently storing the message channels in the tree cliques (BTND): Perhaps parametric is currently storing messages in either tree
or CSMC? https://github.com/JuliaRobotics/IncrementalInference.jl/blob/master/src/JunctionTreeTypes.jl#L203-L204 |
see comment about making a distinction between channels and stored messages: #675 (comment) |
Think we ended up deciding opposite to much of what was said earlier: that msgs must not be stored in CSMC, but somewhere on the tree. It's not super important whether |
While i consume the figures (thanks), I really don't see the hold up between msg channels on edges or in BTND: somewhere in the code a CSM execution asks "GetUpwardChannel(csmc)::Channel{LikelihoodMessage}" and elsewhere another piece of code asks for "GetDownwardChannel(csmc)::Channel{LikelihoodMessage}" ... what does it matter where the channel references are stored, as long as csmc has that pointer? And in both cases I'll work through the figures when i get a chance, perhaps there is something I'm missing. Regardless, to aid consolidation for #459, I'd ask that we please store the messages in BTND since CSM is that much bigger than ParametricCSM. It is much harder to change CSM than ParametricCSM. The two structures should be identical and this seems to be a growing pain during consolidation. The only reason this would be hard is if the "GetMsgChannel(csmc)" functions were not possible, and I think they are easily possible? After consolidation, we can move the references to message channels from BTND to edges (if we end up choosing to do that in the end). |
In short:
|
Hi @Affie , to bring this to a decision -- are we going to do messages in channels that are not stored in either BTND or CSMC, but rather a separate MessageChannels store in BayesTree? If so then BayesTree will in future have to be able to work with subset of cliques (not critical at this stage). We also need a 100% determinstic way to ensure that step by step FSM sandbox repeat calls of of CSM states are exact replicates of the situations at that instant. Since |
I don't think it matters that much. The only requirement that I have is to have a down channel per child. This simplifies sequencing of the cliques and can be used in the future to only send a message to one of the child branches. So I'm consolidating to use the edge messages as in 2 for now. As 1 only has one down channel. My previous function
Remember the channels are not buffered in take!, so technically the tree will not hold any state information if channels are stored in it. For me, the best of both solution at this stage is to make copies of the channels in the CSMC. |
agree 100% with only communicate through channels as hard requirement. down channel each child sounds good too, no issues there. did not connect the dots that channel length 0 means tree doesn't have state -- that's very good i think. in old design i had to sometimes reset channels manually. your approach sounds better. Duplicating channels for debug restep with FSM should be fine, as long as that copying is not the place where things break. if you're happy i'd say hi for it. or avoid if easy, whatever makes the most sense. so design decision on this issue then is model 2 only (old language "pull model") with take-only channel length 0. If you are happy with that @Affie we can close this issue as soon as able. |
ie channels definely not in BTND. |
Ok, so we can reevaluate in the future: |
JIp, as long as the deepcopy point is not some weird place where multithreaded timing etc becomes hard to debug -- sometimes nice to just have full deepcopy of the object as is. Guess we can fix with atomics if that comes up. |
EDIT
CONCLUSION
#675 (comment)
Original Post
Following from #459, we should decide if message channels between cliques are stored in either csmc or tree edges.
Related decisions:
push orpull model)Part of the decision is whether the tree should be read-only during inference.
WIP:
The text was updated successfully, but these errors were encountered: