Request for internal domain adjustment of spline transformations

Hi Everyone,

While using the spline transformation for normalizing flows I realized I was getting these weird tails that would persist and wouldn’t go away after training (this isn’t the best picture because I fixed my code to account for this but the idea is there…).

I then looked at the source code (which I could have seen if I just went to the website so that one’s on me haha) and it showed a requirement of a bound as an input to the spline call

self.sq0 = T.Spline(input_dim=1, count_bins=16, bound = 150, order = 'quadratic')


Effectively, this 150 was the far right edge of my domain [0,150] but what it did was force the spline call to map [0,150]\rightarrow[-150,150].

I fixed this by taking my input data and simply sliding it to be [0,150]\rightarrow[-75,75]. This then removed the tails as I put bound = 75 thereby creating a box from [-75,75]. My outputs then didn’t have this awkward remainder tail.

So I guess if it’s not a pain a nice update here would be to have the code internally shift to do a ‘best bounding box’ perform it, then shift it back when it’s done. If that’s not possible then no worries, just figure I’d show how I fixed this for myself if anyone else comes across it.