Can't run tsne from tensorboard for small number of samples?

Viewed 121

I'm building embedding vectors which I want to view via tensorboard (with TSNE 2D/3D algs)

My codes look:

    logdir = os.path.join("./logs/fit/l", datetime.datetime.now().strftime("%Y%m%d-%H%M%S"))
    w = tf.summary.create_file_writer(logdir)

    projector_distances = train_distances.reshape(train_distances.shape[0], -1)
    weights = tf.Variable(projector_distances, name="latent_test_3")

    checkpoint = tf.train.Checkpoint(latent_test=weights)
    checkpoint.save(os.path.join(logdir, "embedding.ckpt"))

    with open(os.path.join(logdir, 'tags.tsv'), "w") as f:
        for tag in y_test:
            f.write("{}\n".format(tag))

    from tensorboard.plugins import projector
    config = projector.ProjectorConfig()
    embedding = config.embeddings.add()
    embedding.tensor_name = "latent_test/.ATTRIBUTES/VARIABLE_VALUE"
    embedding.metadata_path = 'tags.tsv'
    projector.visualize_embeddings(logdir, config)

In tensorboard I can view the results of PCA, but TSNE or UMAP dosn't work (nothing happen and the buttons are disable):

enter image description here

More info:

train_distances: (938, 14, 14, 8)
projector_distances: (938, 1568)

I can run tsne algorithm from code (for same data):

from sklearn.manifold import TSNE
model = TSNE(n_components=2, random_state=0)
y = model.fit_transform(projector_distances)

If I use bigger dataset (with more than 1568 samples (i.e number of samples >= number of features) I can view the results from tensorboard.

  1. What is wrong ?
  2. Why I can run tsne (from code) for small dataset, while I can't run tsne from tensorboard ?
1 Answers

I could able to use T-SNE on Tensorboard for my own embeddings.

enter image description here

Related