Git Product home page Git Product logo

tsne-pytorch's People

Contributors

mxl1990 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

tsne-pytorch's Issues

tsne on Pytorch tensors

Hello

I have an array of Tensors which represents words in certain language.
Is it possible to run tsne on this array? thanks
image

{IndexError}index 2048 is out of bounds for dimension 1 with size 2048

Hello, my test code is as follow:

X1 = torch.randn([10, 2048]).cuda()
X_emb = TorchTSNE(n_components=2, perplexity=100., n_iter=1000).fit_transform(X1)

Sometimes, it will occur '{IndexError}index 2048 is out of bounds for dimension 1 with size 2048', I find the reason is that as 121 line in the tsne_pytorch.py, there may be out of bounds:

119 for i in range(d):
120     if l[i, 1] != 0:
121         M[:, i+1] = M[:, i]
122         i += 1

Concretely, i may equal to d-1 in 121 line which causes M[:,i+1] will be out of bounds(we know M is dxd).

I wonder if the modified code as follow is right?

for i in range(d-1):
    if l[i, 1] != 0:
        M[:, i+1] = M[:, i]
        i += 1

parameter issue

Thank you for sharing the code. Is max_iter = 1000 fixed, or set it according to own data set?

tsne gives nan

Here is an example:

from tsne_torch import TorchTSNE as TSNE
# from sklearn.manifold import TSNE
import torch
import torchvision
import torchvision.transforms as transforms
import matplotlib.pyplot as plt

dataset = torchvision.datasets.MNIST(root="path of the dataset",
                                     train=False,
                                     download=False,
                                     transform=transforms.ToTensor())
x = dataset.data
n = x.shape[0]
x = x.reshape(n, -1)
n0 = int(0.01 * n)
x = torch.tensor(x[:n0], dtype=torch.float32)

X_tsne = TSNE(n_components=2, perplexity=10, n_iter=250,
              verbose=True).fit_transform(x)
print(X_tsne)

This gives a series of nans. However, if we use sklearn instead (as commented in the original code), this gives some meaningful results.

Could you please figure out why this is the case?

Dealing with imaginary eigenvalues

Hello,
As i understand , this line deals with imaginary eigenvalues, and creates real eigenvectors in M. according to the torch documentation for eig, the suggestion is to perform linear combinations of the ith and i+1th initial eigenvectors to get the real eigenvectors. however in the code there seems to just be a reassignment, which will still leave M[:,i] complex if it was originally so ( because then M[:,i+1] would have been complex as well)
can you please verify this line is correct?

torch.eig

Hello,I have a question when I run (l, M) = torch.eig(torch.mm(X.t(), X), True) ,sometimes the program is stuck,Is this a torch version issue?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.