| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
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.)
There was a problem hiding this comment.
This is clever.
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
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.)
(See the first remaining issue of #20752, which is the motivation for this.)
PR Summary
PR Checklist
Tests and Styling
Documentation