Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add_embedding expected hierarchy #10

Closed
lucabergamini opened this issue Aug 14, 2017 · 4 comments
Closed

add_embedding expected hierarchy #10

lucabergamini opened this issue Aug 14, 2017 · 4 comments

Comments

@lucabergamini
Copy link
Contributor

Hello again
I'm currently experimenting with the embeddings' visualization, and i'm having some troubles with the expected folder hierarchy. As far as I have understand, the add_embedding function does not have any timestep parameters (although there is one in the function called with value None), so it does not provide a time distributed visualization. The current hierarchy of my loggings is the following:

-project
--runs
---August14_11:24:12
----event.out
---August14_11:28:12
----event.out

i.e. every running gets his own directory with the SummaryWriter events (file event.out), and i can run everything using tensorboard from the project dir (tensorboard --logdir runs).

If I use add_embedding for one of the experiments with the following notation

add_embedding(torch.FloatTensor(out_numpy),save_path='runs/August14_11:28:12',metadata=[k.data.numpy()[0]  for k in label_batch ])

I get one warning each time complaining about the fact the dir already exists, and the embedding log file get overwritten each time, so I can see only the last one written.

However if I log to a subdir with the following notation

add_embedding(torch.FloatTensor(out_numpy),save_path='runs/August14_11:28:12/emb{}'.format(unique_id),metadata=[k.data.numpy()[0]  for k in label_batch ])

I can't see any embedding in the visualization's page, and i have to run tensorboard directly in the embedding log directory (e.g. tensorboard --logdir runs/August14_11:28:12/emb0), which is a bit of a pain if I log every 25 batch.

Any solutions of best practices?

@lanpa
Copy link
Owner

lanpa commented Aug 14, 2017

This will be fixed together with #5. Maybe this weekend.

@lucabergamini
Copy link
Contributor Author

I did not see it, my bad :) Keep up the good work :)

@lucabergamini
Copy link
Contributor Author

I've written a class named EmbeddingWriter which may be useful as baseline to include embeddings in the SummaryWriter. It use a single projector_config file and a level of subfolders to hold the different timestep, each one including the metadata,tensors and sprite. The results seem pretty good for now as shown below , should i submit a PR?
prop

@lanpa
Copy link
Owner

lanpa commented Aug 16, 2017

Of course!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants