tensorflow / tensorflow/probability

Normal Inverse Gaussian and Softplus NaN Gradient

Open
#1,835 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Jupyter Notebook
Stars
4.4k
Forks
1.1k
PR merge metrics
No merged PRs in 30d

Description

I've been encountering an error training my models with NaNs being introduced from the gradients during training. I think I've narrowed the cause down to be the combination of the normal inverse gaussian and a subsequent softplus bijector. I've tried reproducing with the normal distribution as well, but seem unable to. I haven't seen the issue with a bare distribution since #1778 was fixed, so I suspect this is something else.

A gist of the issue is here.
The model creation and fit function are in a loop because despite setting the seeds for TF and NP at the top, there is still some other source of randomness that causes it to only fail sometimes.

Any help would be appreciated.

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 by running the linked gist and inspecting the model-training loop that combines the normal inverse Gaussian with the softplus bijector. Compare the intermittent NaN gradients with the normal-distribution case and the behavior described in issue #1778; done means the failure is reproducible, its source is identified, and the gradient behavior is corrected.

Written by the indexing model from the issue text.

Assessment

Tech stack
tensorflow
Domain
machine-learning
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.