我正在寻找一种在悬停时显示嵌入精灵的方法,与使用Tensorboard投影仪时的常量相反。下面的代码成功创建了一个嵌入式电路板,并将适当的元数据和精灵附加到每个数据点。但是,我尝试可视化超过10,000点的数据集,因此在单个屏幕上显示所有图像会使探索变得异常困难。相反,我正在寻找一种仅在悬停时显示精灵图像的方法,与常量相反。有没有人能够做到这一点?
from tensorflow.contrib.tensorboard.plugins import projector
with tf.Session() as sess:
# Create summary writer.
writer = tf.summary.FileWriter('./graphs/embedding_test', sess.graph)
# Initialize embedding_var
sess.run(embedding_var.initializer)
# Create Projector config
config = projector.ProjectorConfig()
# Add embedding visualizer
embedding = config.embeddings.add()
# Attach the embedding name
embedding.tensor_name = embedding_var.name
# Data point meta data
embedding.metadata_path = EMBEDDING_META_PATH
#associate data point sprite
embedding.sprite.image_path = EMBEDDING_SPRITE_PATH
#specify dimensions of images within sprite
embedding.sprite.single_image_dim.extend([imgSize, imgSize])
# Add writer and config to Projector
projector.visualize_embeddings(writer, config)
# Save the model
saver_embed = tf.train.Saver([embedding_var])
saver_embed.save(sess, './graphs/embedding_test/embedding_test.ckpt', 1)
writer.close()