facebookresearch / poincare-embeddings

PyTorch implementation of the NIPS-17 paper "Poincaré Embeddings for Learning Hierarchical Representations"

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to get embeddings?

CallMeNumber1 opened this issue · comments

I wonder what should i do to get poincare-embeddings after ruuning ./train-nouns.sh, which will result in a '.pth' file, and then how to get embeddings from the '.pth' file?

This should do it:

import torch
chkpnt = torch.load('<path to checkpoint>')
embeddings = chkpnt['model']['lt.weight']