GerryChainJulia icon indicating copy to clipboard operation
GerryChainJulia copied to clipboard

Add new balance edge algos & reversible ReCom

Open pjrule opened this issue 4 years ago • 2 comments

This PR is too big, which probably means the balance edge algorithms should live in their own file so that they can be reviewed separately. Right now, this PR contains:

  • A contraction-based balance edge algorithm ported from GerryChain by @matthewkol186
  • A memoization-based balance edge algorithm created by me
  • An implementation of reversible ReCom
  • Iterator-based APIs for ReCom and reversible ReCom
  • API changes to make various components of the chain (balance edge function, tree function, etc.) more hot-swappable

pjrule avatar Nov 11 '20 18:11 pjrule

I agree that this PR is too big. I would like the PR to be split further and with unit tests to feel better about it. One way you could break this PR down could be;

  • I like the idea of a separate file, something like tree_partition.jl that can handle balanced cut algorithms.
  • A single reversible recom PR without using the resumable library
  • Adding the @resumable / @yield functionality separately. or using the Base.iterator suggestion that @matthewkol186 made last week?

I do understand that this seems like a lot of work. Let's talk about this though! Also thanks for the good function documentation!

bsuwal avatar Nov 18 '20 20:11 bsuwal

Let's split things into three files:

  • recom.jl - regular ReCom proposal and auxiliary functions.
  • revrecom.jl - reversible ReCom proposal and auxiliary functions.
  • balance.jl - algorithms for finding balanced cuts (common to both chains)

@bsuwal suggests splitting the balanced cuts code out into a separate PR.

pjrule avatar Nov 18 '20 22:11 pjrule