You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to store a sequence of trees derived from a Metropolis-Hastings MCMC sampler. This sampler stores its current state as a networkx.DiGraph object, and keeps track of how it changes the graph using a memento.
I propose the following features:
a function that converts a sequence of DiGraphs into a tree sequence
a class that can create a tree sequence from an initial DiGraph object and a sequence of mementos that describe successive changes to the DiGraph object, where each memento represents a sample from the MCMC chain.
In principle, one could then implement an import of arbitrary sequences of trees simply by mapping each tree in the import data to a DiGraph, and feeding those DiGraph objects into 1. I think that would reduce the amount of code needed for tree import as seen in for example #11 because it separates tree parsing from tree sequence creation.
However, my real interest is in 2., which should be more efficient than 1. because 2. would be able to easily infer what information is not redundant and therefore worth storing for each successive tree in the sequence. This would allow the construction of large tree sequences while using minimal amounts of memory and without the need for intermittent sort or simplify calls.
I welcome feedback on this proposal.
The text was updated successfully, but these errors were encountered:
winni2k
changed the title
networkx.DiGraph import
networkx.DiGraph import
Jun 23, 2020
Sounds good to me @winni2k! I'm happy to look over any prototypes if you want to open a draft PR. There's no worries about dependencies etc in this repo, so just do whatever is most convenient. I'm interested to see how your mementos work.
I would like to store a sequence of trees derived from a Metropolis-Hastings MCMC sampler. This sampler stores its current state as a
networkx.DiGraph
object, and keeps track of how it changes the graph using a memento.I propose the following features:
In principle, one could then implement an import of arbitrary sequences of trees simply by mapping each tree in the import data to a DiGraph, and feeding those DiGraph objects into 1. I think that would reduce the amount of code needed for tree import as seen in for example #11 because it separates tree parsing from tree sequence creation.
However, my real interest is in 2., which should be more efficient than 1. because 2. would be able to easily infer what information is not redundant and therefore worth storing for each successive tree in the sequence. This would allow the construction of large tree sequences while using minimal amounts of memory and without the need for intermittent sort or simplify calls.
I welcome feedback on this proposal.
The text was updated successfully, but these errors were encountered: