1

So I have this code that generates and plots t-SNE. actions is (512,12) so 512, 12-dimensional points. When I put this into the command line:

actions.unique(dim=0).shape
torch.Size([2, 12])

We can see that there are only 2 unique points. But after it is projected into 2-dimensional space using Sklearn's t-SNE function it looks like this:"

enter image description here

Shouldn't there just be 2 points? Why does it look like this?

Plotting Code:

def create_subplot(z_tensor, index: int, title: str, axes):
    tsne = TSNE(n_components=2, random_state=123)
    z_enc = tsne.fit_transform(z_tensor.detach().cpu().numpy())
    # sns.scatterplot(data=z_enc, ax=axes[index])
    axes[index].scatter(x=z_enc[:, 0], y=z_enc[:, 1])
    axes[index].set_title(title)

create_subplot(z_tensor=actions, index=4, title="actions", axes=axes)
Gooby
  • 621
  • 2
  • 11
  • 32

0 Answers0