Comments (7)
Probably best to allow nan
and inf
to be returned from score functions...
from pints.
See #251
from pints.
Hmm, I'd be wary about dealing with such things too nicely and allowing them to happen quietly. In my limited experience it points to bad choices within the model itself, the parameter scalings, or the prior. I'd generally advocate failing loudly with nice suggestions of what to investigate!
from pints.
from pints.
OK.
There's a couple of levels on which we need to deal with these things:
- In the models we write (not a pints issue!)
- In ErrorMeasure and LogLikelihood classes provided by Pints. Here we could, for example, check that the input to these measures (the model results) can never contain
NaN
. And perhaps we could check the returned value for NaN too, but too be honest that would only occur if the data had aninf
and the simulation had aninf
of the opposite sign, so seems a bit of an odd case to sacrifice performance for? - If users define their own error measures or loglikelihoods (or logpdfs) we can only handle things inside the individual methods. I'm inclined to ignore this level, as it'd mean extra code in every method?. We could decide to check for it in the
Optimisation
andMCMCSampling
classes that useOptimisers
etc. (so the few "controller" classes that most users will use), as a happy medium?
from pints.
For point 3: We're currently building an architecture that separates controllers (things that check stopping criteria, do parallelisation, talk nicely to the user etc.) from the individual methods (CMAES, PSO, AdaptiveCovarianceMCMC) that propose points to evaluate and then perform some kind of update step. For example see here: https://github.com/pints-team/pints/blob/master/pints/_optimisers/__init__.py#L154-L476
from pints.
In the end, this all boils down to the following convention:
- If
NaN
s occur, feel free to let things crash - For error measures and (unnormalised) log likelihoods,
+inf
and @-inf
are perfectly acceptable answers so don't treat them in any special way
The only exception to rule 2 is that we ask that the first point for any optimisation/inference problem has a finite error/log_pdf, so that we don't start from a garbage point
from pints.
Related Issues (20)
- Refactor NoUTurnMCMC for pickling HOT 9
- OptimisationController.set_parallel() no longer speeds up optimisation for CMAES HOT 1
- Add testing on 3.10 HOT 1
- Tiny typo in plot docs
- Don't use the variable name "values" in the examples
- Extended scatter search optimiser
- Optionally copy logpdfs before running mcmc HOT 3
- sample generative model HOT 1
- Stan interface notebook is broken HOT 1
- Transformed rectangular boundaries HOT 5
- Chained transformations
- UnitCubeTransformation or ScalingTranslationTransformation
- ScalingTransformation has visible properties, could do with better docs
- Add and fix HABC sampler using SGHMC HOT 1
- Header of logged "time" field is wrong HOT 3
- Can't reproduce Stochastic Degradation model: No module named 'pints.toy.stochastic' HOT 4
- NUTS coroutines don't work on Python 3.11 HOT 5
- badges not displaying in readme.md
- Settings of XNES HOT 2
- Likelihood for censored data
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pints.