tpapp / LogDensityProblems.jl

A common framework for implementing and using log densities for inference.
Other
40 stars 9 forks source link

revamp stress testing #108

Open tpapp opened 6 months ago

tpapp commented 6 months ago

It is time for a redesign of the stress testing framework. Specifically,

  1. Restrict input range. Using Cauchy for random coordinates is excessive, as it can easily result in values outside 1000 which is crazy, and leads to hiccups even for posteriors that are carefully implemented numerically but have a nonlinear transformation (eg anything remotely involving exp).

  2. Reporting should be more nuanced. Every bad value should have a list of properties that were violated (eg non-finite but inf values, non-finite derivatives, incorrect derivatives when compared against finite differences, etc). Cf #42.

  3. Stress tests should be modular, allowing the user to pick and combine them as necessary.

tpapp commented 6 months ago

Tentatively, I am thinking about the following:

  1. each stress test is a module, that reports the order it needs (derivatives or not),
  2. stresstest figures out the values it needs,
  3. random coordinate generation is also customizable (eg box in [-B, B]^D where B is around 50,
  4. random coordinates are generated, derivatives are calculated up to order K, then each module checks something and then either returns nothing or something that will be inserted into a vector that is paired with each offending coordinate.