tvb-root icon indicating copy to clipboard operation
tvb-root copied to clipboard

WIP: Parameters api

Open i-Zaak opened this issue 3 years ago • 6 comments

Missing:

  • [ ] a demo
  • [x] check if some parts in the showcase can be refactored here
  • [ ] polish (e.g. docstrings, tests)

i-Zaak avatar Mar 31 '22 12:03 i-Zaak

@i-Zaak thanks I will look at the deepcopy issue since that's an annoying thing to have crop up.

maedoc avatar Mar 31 '22 12:03 maedoc

The showcase has implementation of a UNICORE runner, which is IMHO better to be left outside the generic API presented here. However I've also subclassed the joblib exec there to make use of the Numba backend. This we should have available as config of the JoblibExec here.

i-Zaak avatar Mar 31 '22 12:03 i-Zaak

Unicore is a good point, since it's being solved in the framework regardless, we should try to make reuse of it.

maedoc avatar Mar 31 '22 12:03 maedoc

wdyt about generalizing values: List[List[Any]], e.g.

class Value:
    # implement iter protocol

class SimSeq:
    ...
    values: List[Value]

Ideally I'd want to cover use cases of

  • Cartesian product grid search e.g. values=itertools.product(*[np.r_[:1.0:10j] for _ in range(3)])
  • Precomputed arrays of values e.g. values=saltelli.sample(problem, 1024) (from SAlib)
  • SBI obv
  • Proper distribution support or at least normal, log normal

For the last case, we'd have parallel sampling of the distributions as in Monte-Carlo, and "single-threaded" MCMC, where the SimSeq is realized sample by sample from a small number of chains. I'm not sure if these are similar enough to warrant a common implementation or not.

maedoc avatar Mar 31 '22 13:03 maedoc

I would also be ok if we just merge this to have the basic parts in place, and leave generalization to a later issue. ok @i-Zaak ?

maedoc avatar Apr 28 '22 07:04 maedoc

can we merge something now to avoid getting stale? or go back to drawing board and redo?

maedoc avatar Dec 05 '22 22:12 maedoc

I think we can close this, as a more advanced API can be found here: https://github.com/the-virtual-brain/tvb-inversion/blob/main/tvb_inversion/parameters.py Do you agree @i-Zaak ?

liadomide avatar Feb 28 '23 13:02 liadomide