patrick-kidger / patrick-kidger/diffrax

Treating Channels that only have missing values in interpolations

Open
#323 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Python
Stars
2.1k
Forks
189
Avg merge
3d 18h
Merged PRs (30d)
1

Description

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.

issue

The result of the print statement when I run get_data(1000, False, key=jrandom.PRNGKey(0)) is as follows:

result

Thank you in advance!

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at diffrax.backward_hermite_coefficients and reproduce the issue through get_data(1000, False, key=jrandom.PRNGKey(0)), including channels containing only NaNs. Done means channels with all missing values produce constant interpolation coefficients equal to replace_nans_at_start rather than NaNs.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.