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.

Bug: NaN result with projection to 1D latent space

See original GitHub issue

Hi,

thanks for publishing and maintaining this cool project! I played around with UMAP a bit and encountered an oddity: I have a small (n=178) distance matrix that I want to project onto a 1D space. If I run UMAP in version 0.3.0 with the default parameters, sometimes the resulting low-dimensional data consists of NaNs exclusively while sometimes the result seems perfectly fine.

I narrowed it down to the random_state being used, which seems a bit fishy. To reproduce: I call

res = umap.UMAP(
    n_components=1,
    random_state=8, 
    metric='precomputed'
).fit_transform(high_dim_data)

print(numpy.count_nonzero(numpy.isnan(res)))

where high_dim_data is as defined in https://gist.github.com/rmitsch/cd99fcacf6a8f3c0d41af6f903735251.

I didn’t observe this behaviour with n_components > 1, but haven’t checked thoroughly yet. I just tried various values for random_state until I could reproduce the NaN result.

Is this a known problem? I couldn’t find any related issues.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:2
  • Comments:12 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
lmcinnescommented, Aug 17, 2018

I wanted to verify this fixes the issue for others before releasing an update to PyPI (which should be on version 0.3.2 by now anyway – note that you need umap-learn on PyPI). Will try to get an update rolled out soon. Thanks for the feedback and the reproducer everytone – it helped a lot.

On Fri, Aug 17, 2018 at 8:43 AM Raphael Mitsch notifications@github.com wrote:

Fixes my problem. The version currently available on pip (0.1.1) does not contain the fix though, does it? I just copied the changes in your commit by hand for now.

Thanks!

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/lmcinnes/umap/issues/85#issuecomment-413853449, or mute the thread https://github.com/notifications/unsubscribe-auth/ALaKBQyzIqFgIik7z46-pUO_3_NGxnmFks5uRrpVgaJpZM4VS04v .

2reactions
lmcinnescommented, Aug 9, 2018

Fine suggestion. I set a loop running until I got a failure, which is now reproducible with that seed. I’ll try to dig into this soon and see what the actual underlying issues is. Thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Importing data with NaN or missing value
Hello,nI was just wondering if I can import a profile with NaN or missing data ... The profile interpolation is fairly dumb so...
Read more >
Understanding Latent Space in Machine Learning | by Ekin Tiu
In this use case, our latent space representations are used to transform more complex forms of raw data (i.e. images, video), into simpler ......
Read more >
Autoencoder Feature Extraction for Classification
An autoencoder is a neural network that is trained to attempt to copy its input to its output. — Page 502, Deep Learning,...
Read more >
10.1 Principal Component Analysis: Maximum Variance (UvA
See https://uvaml1.github.io for annotated slides and a week-by-week overview of the course.This work is licensed under a Creative Commons ...
Read more >
Principal component analysis of raw data - MATLAB pca
[ coeff , score , latent ] = pca(___) also returns the principal component ... Error using pca (line 180) Raw data contains...
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