Skip to content

t-sne visualization #18

@zhaoyun-ai

Description

@zhaoyun-ai

Can you tell me more details about t-sne visualization?I reproduced your program on the magnatagatune dataset and got PR-AUC of 0.3496 and ROC-AUC of 0.886. I noticed that you used t-sne visualization in your paper. But when I tried to visualize the obtained features, I got a bad visualization result. I put 'extract_ 'representations' in 'representations' is converted to list format as the input of t-sne. The feature map I got shows that the features are not well distinguished, I printed the representations and found that each feature was similar. I would like to know what is your input when visualizing with t-sne. I want to get a good feature visualization.

def extract_representations(self, dataloader: DataLoader) -> Dataset:

    representations = []
    ys = []
    for x, y in tqdm(dataloader):
        with torch.no_grad():
            h0 = self.encoder(x)
            representations.append(h0)
            ys.append(y)

    if len(representations) > 1:
        representations = torch.cat(representations, dim=0)
        ys = torch.cat(ys, dim=0)
    else:
        representations = representations[0]
        ys = ys[0]

    tensor_dataset = TensorDataset(representations, ys)
    return tensor_dataset

1%| | 1/147 [00:08<21:49, 8.97s/it][tensor([[ 0.0147, 0.0385, 0.0067, ..., -0.0021, -0.0179, -0.0170],
[ 0.0146, 0.0385, 0.0067, ..., -0.0021, -0.0179, -0.0170],
[ 0.0146, 0.0385, 0.0067, ..., -0.0021, -0.0179, -0.0170],
...,
[ 0.0147, 0.0385, 0.0067, ..., -0.0021, -0.0179, -0.0170],
[ 0.0146, 0.0385, 0.0067, ..., -0.0021, -0.0179, -0.0170],
[ 0.0146, 0.0385, 0.0067, ..., -0.0021, -0.0179, -0.0170]])]
[tensor([[ 0.0147, 0.0385, 0.0067, ..., -0.0021, -0.0179, -0.0170],
[ 0.0146, 0.0385, 0.0067, ..., -0.0021, -0.0179, -0.0170],
[ 0.0146, 0.0385, 0.0067, ..., -0.0021, -0.0179, -0.0170],
...,

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions