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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃殮馃捇 Fix TransformerEncoder tokens' device #861

Merged
merged 9 commits into from
Apr 5, 2022

Conversation

mberr
Copy link
Member

@mberr mberr commented Apr 5, 2022

Fix #858 (comment)

simplified MWE

from pykeen.pipeline import pipeline
from pykeen.datasets import get_dataset
from pykeen.nn.representation import LabelBasedTransformerRepresentation
from pykeen.models import ERModel

dataset = get_dataset(dataset="nations")
entity_representations = LabelBasedTransformerRepresentation.from_triples_factory(
    triples_factory=dataset.training,
)
result = pipeline(
    dataset=dataset,
    model=ERModel,
    model_kwargs=dict(
        interaction="distmult",
        entity_representations=entity_representations,
        relation_representations_kwargs=dict(
            shape=entity_representations.shape,
        ),
    ),
    training_kwargs=dict(
        num_epochs=1,
    ),
)

@mberr
Copy link
Member Author

mberr commented Apr 5, 2022

locally tested successfully on a GPU machine

@mberr mberr changed the title Fix TransformerEncoder tokens' device 馃殮馃捇 Fix TransformerEncoder tokens' device Apr 5, 2022
trigger ci
@thtang
Copy link

thtang commented Apr 5, 2022

Could I use the latest code via

git clone https://github.com/pykeen/pykeen.git
cd pykeen
pip install -e .

?

@mberr
Copy link
Member Author

mberr commented Apr 5, 2022

Could I use the latest code via

git clone https://github.com/pykeen/pykeen.git
cd pykeen
pip install -e .

?

Yes, but you need to switch the branch before running pip install:

git clone https://github.com/pykeen/pykeen.git
git checkout fix-label-based-repr
cd pykeen
pip install -e .

@mberr
Copy link
Member Author

mberr commented Apr 5, 2022

@PyKEEN-bot test

@cthoyt cthoyt enabled auto-merge (squash) April 5, 2022 11:34
@cthoyt cthoyt merged commit 0966369 into master Apr 5, 2022
@cthoyt cthoyt deleted the fix-label-based-repr branch April 5, 2022 11:44
@cthoyt cthoyt added the bug Something isn't working label Apr 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

How to upgrade PyKEEN<1.8.0 code that uses EmbeddingSpecification?
4 participants