gaurav-arya / StochasticAD.jl

Research package for automatic differentiation of programs containing discrete randomness.
MIT License
199 stars 16 forks source link

Add tests for propagate #134

Open GuusAvis opened 1 month ago

GuusAvis commented 1 month ago

Added two new tests of propagate that check if finite perturbations returned by functions upon normal calls are treated correctly by propagate.

  1. Adding two stochastic triples together, like in https://github.com/gaurav-arya/StochasticAD.jl/issues/128#issue-2354290214; the way I'm constructing the stochastic triples may be nonstandard/bad practice though.
  2. Step-game-like example that @gaurav-arya provided in https://github.com/gaurav-arya/StochasticAD.jl/pull/132. It's a statistical test so it can fail, but I set some pretty wide margins (basically 10 sigma) so it should be quite rare I think. Let me know if this is what you had in mind.

I'm open to suggestions!

I expect the tests for this PR to fail because there are still the issues in #133 , probably that should be dealt with first before looking more closely at this one.