question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

InputNormalization: std can return all nan values

See original GitHub issue

If you have a tensor of all negative values (ex. x = torch.FloatTensor([[-100.0,-100.0,-100.0,-100.0,]]), then torch.std(x, dim=0) will return all nan values.

There is no check or warning when this occurs.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
mravanellicommented, Feb 12, 2021

I think here the solution is to create a numerically stable normalization, just like other normalization modules such as batch norm or layer norm.

On Fri, 12 Feb 2021 at 13:17, Parcollet Titouan notifications@github.com wrote:

Such a feature could be very helpful if you can provide us with any pointer

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/speechbrain/speechbrain/issues/493#issuecomment-778358895, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEA2ZVSHDRJ5KM6RKDGFPLLS6VWC5ANCNFSM4XQALXSQ .

0reactions
mravanellicommented, Feb 20, 2021
Read more comments on GitHub >

github_iconTop Results From Across the Web

Keras model params are all "NaN"s after reloading
One thing to notice is that I make all batch normalization layers "trainable" so that BN related params can be updated with my...
Read more >
Why my model returns nan? - PyTorch Forums
LayerNorm(output) might return a all nan vector. Similiar problem happens in my attention model, I'm pretty sure that it can't be exploding ...
Read more >
How to use Data Scaling Improve Deep Learning Model ...
Standardizing a dataset involves rescaling the distribution of values so that the mean of observed values is 0 and the standard deviation is...
Read more >
std::nan, std::nanf, std::nanl - cppreference.com
Converts the character string arg into the corresponding quiet NaN value, as if by calling std::strtof, std::strtod, or std::strtold, ...
Read more >
std function returns NaN for long floats · Issue #5725 - GitHub
Calling .groupby().std() on a dataframe with long floating point numbers returns NaNs and a warning. This occurs because internally the ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found