Commit a5abb46
committed
Autoinfer norm bounds.
Instead of special-casing lognorm to only autoscale from positive
values, perform autoscaling from values that map to finite transformed
values. This ensures e.g. that make_norm_from_scale(LogitScale)
automatically does the right thing (autoscaling from values in [0, 1]).
This means that autoscale() and autoscale_None() are now slightly more
expensive (because the transform needs to be applied), so skip the call
to autoscale_None if not needed. However, note that these should
typically only be called once per norm anyways, so hopefully this isn't
a bottleneck.
(Another idea would be to use `trf.inverse().transform([-np.inf,
np.inf])` as clipping bounds, but there are some tests using `x->x**2`
/ `x->sqrt(x)` as a test for FuncNorm, which 1. doesn't go all the way
to -inf, and 2. isn't even increasing for negative x's, so that idea
doesn't work.)1 parent 092f833 commit a5abb46
1 file changed
+13
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1229 | 1229 | | |
1230 | 1230 | | |
1231 | 1231 | | |
1232 | | - | |
| 1232 | + | |
| 1233 | + | |
1233 | 1234 | | |
1234 | 1235 | | |
1235 | 1236 | | |
| |||
1520 | 1521 | | |
1521 | 1522 | | |
1522 | 1523 | | |
1523 | | - | |
| 1524 | + | |
| 1525 | + | |
1524 | 1526 | | |
1525 | 1527 | | |
1526 | 1528 | | |
| |||
1555 | 1557 | | |
1556 | 1558 | | |
1557 | 1559 | | |
| 1560 | + | |
| 1561 | + | |
| 1562 | + | |
| 1563 | + | |
| 1564 | + | |
| 1565 | + | |
| 1566 | + | |
| 1567 | + | |
| 1568 | + | |
1558 | 1569 | | |
1559 | 1570 | | |
1560 | 1571 | | |
| |||
1603 | 1614 | | |
1604 | 1615 | | |
1605 | 1616 | | |
1606 | | - | |
1607 | | - | |
1608 | | - | |
1609 | | - | |
1610 | | - | |
1611 | | - | |
1612 | | - | |
1613 | | - | |
1614 | 1617 | | |
1615 | 1618 | | |
1616 | 1619 | | |
| |||
0 commit comments