Closed avibryant closed 4 years ago
I'll add an issue for adding tests for this.
Merging #420 into 0.3-dev will increase coverage by
1.07%
. The diff coverage is81.25%
.
@@ Coverage Diff @@
## 0.3-dev #420 +/- ##
===========================================
+ Coverage 54.9% 55.97% +1.07%
===========================================
Files 69 70 +1
Lines 2683 2751 +68
Branches 149 150 +1
===========================================
+ Hits 1473 1540 +67
- Misses 1210 1211 +1
Impacted Files | Coverage Δ | |
---|---|---|
...src/main/scala/com/stripe/rainier/core/Model.scala | 64.7% <0%> (ø) |
:arrow_up: |
...c/main/scala/com/stripe/rainier/plot/Jupyter.scala | 0% <0%> (ø) |
:arrow_up: |
...c/main/scala/com/stripe/rainier/compute/Real.scala | 79.01% <94.44%> (+4.4%) |
:arrow_up: |
...main/scala/com/stripe/rainier/compute/Bounds.scala | 96% <96%> (ø) |
|
...ain/scala/com/stripe/rainier/compute/RealOps.scala | 79.16% <0%> (+1.66%) |
:arrow_up: |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update 910b853...f21a96d. Read the comment docs.
This tracks a (lower,upper) bound (as a double) for any
Real
, by starting eachVariable
at (-inf,inf), and starting eachConstant(k)
at (k,k), and then doing interval arithmetic to transform the bounds for any operations.It works surprisingly well - eg
Exponential(3).param.logistic.bounds
givesBounds(0.5,1.0)
.The idea is then to have assertions in the constructors for distributions that enforce bounds like stddev has to be positive. This acts a bit like type checking for your models.
Before this is useful, we'll need to also add accurate bounds to
Placeholder
that are computed duringModel.observe
, otherwise we'll likely get assertion failures every time we useFn
. (We also need to add in the actual assertions).