Closed wbenoit26 closed 1 month ago
@EthanMarx This is at the point that it would be good to have you take a look at it. There remain a couple of issues with matching exactly with SciPy's implementation, but I think the code is usable with the caveats that I describe in the documentation.
So the spline interpolation is a general interpolator that could be (potentially) used for different use cases, and then you are just implementing it for the Qtransform?
Exactly, yeah
Adding the spline interpolation into
ml4gw
and integrating it into the Q-transform. Still a lot to do, but I wanted to get something pushed so people could take a look at it. The main changes compared to the original are:ml4gw
To-do:
double
, minor deviations accumulate from various factors: different data input shape,einsum
vs.matmul
, order of multiplication, etc. These deviations get exacerbated by the finaltorch.linalg.solve
in calculating the spline coefficients. I don't think there's anything I can do about this, but the approach is valid and the typical error between the two methods is small, so I'm going to mark this as done.SplineInterpolate
. The current setup makes it a little awkward to do 1D interpolation,and I want to put back the functionality from the original code that allowed specifying just the input/output size.SplineInterpolate
scipy
. I know that this interpolation has edge effects that aren't present inscipy
, but it would be good to ensure that everything mostly agrees.SingleQTransform
. It would be nice to be able to specify whether the full spline interpolation is desired, or whether some presettorch
option is sufficient. This is particularly important because the matrix inversion that occurs during the spline interpolation takes up a lot of memory for large matrices, and so may not be desirable for some use cases.