Skip to content

Visualizing Latent space #77

Answered by clementchadebec
aissak21 asked this question in Q&A
Discussion options

You must be logged in to vote

Hello,
This feature was recently implemented in #76 (using the embed method) and should be available in the next release.

embedding = model.embed(your_data_tensor)

Before this, you can do the following

>>> model.encoder(your_data).embedding

E.g.

>>> from pythae.models import AutoModel
>>> model = AutoModel.load_from_hf_hub("clementchadebec/reproduced_beta_tc_vae", allow_pickle=True)
Downloading config file ...
Downloading BetaTCVAE files for rebuilding...
Successfully downloaded BetaTCVAE model!
>>> import torch
>>> x = torch.randn(3, 1, 64, 64)
>>> emb = model.encoder(x).embedding
>>> emb.shape
torch.Size([3, 10])

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@aissak21
Comment options

Answer selected by aissak21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants