diffrax
diffrax copied to clipboard
Treating Channels that only have missing values in interpolations
While using "diffrax.backward_hermite_coefficients", I noticed that the interpolation technique doesn't take into consideration the case when all the entries are missing (i.e. NaN), even if "replace_nans_at_start" is specified. I beleive that the logical thing to have is just a constant value in these channels (equal to the one specified by replace_nans_at_start), but the interpolation technique is returning NaNs as coefficients.
As a reproducable example, I used a function that has been used in the neural_cde example (get_data), and I updated the last couple of lines to stack channels with only NaN values.
The result of the print statement when I run get_data(1000, False, key=jrandom.PRNGKey(0)) is as follows:
Thank you in advance!
Thanks for the report!
I beleive that the logical thing to have is just a constant value in these channels (equal to the one specified by replace_nans_at_start)
I agree, this would be better behaviour.
I'm not sure I'll have time to tackle this one soon -- if anyone feels up to it I'd be happy to take a PR fixing this.