uma-pi1 / kge

LibKGE - A knowledge graph embedding library for reproducible research
MIT License
776 stars 124 forks source link

Conve's embedder dimension discrepancy #239

Closed jwzhi closed 3 years ago

jwzhi commented 3 years ago

Hi,

I wonder why there is a dimension discrepancy between the dimension my config file sets and the actual model's dimension only for the ConvE implementation. For example, if I set

reciprocal_relations_model:
  base_model:
    type: conve
    entity_embedder:
      dim: 200
      dropout: 0.3

in my config.yaml. The actual embedder in the kge model is

(_entity_embedder): LookupEmbedder(
      (_embeddings): Embedding(14541, 201)
      (dropout): Dropout(p=0.3, inplace=False)
    )

This is really weird. And I tried with some other score functions such as distmult, transe and they seem to be fine. Do you have an idea why this happens for conve?

Thanks,

rufex2001 commented 3 years ago

ConvE has a setting that automatically adjusts the embedding sizes to ensure a given ratio of the 2D embeddings. You can turn this off by setting "autocomplete: False" (I think it was autocomplete). In that case, though, you'd have to manually ensure the 2D conversion holds, or ConvE will not work.

On Wed, 27 Oct 2021, 05:35 Jing Zhu, @.***> wrote:

Hi,

I wonder why there is a dimension discrepancy between the dimension my config file sets and the actual model's dimension only for the ConvE implementation. For example, if I set

reciprocal_relations_model: base_model: type: conve entity_embedder: dim: 200 dropout: 0.3

in my config.yaml. The actual embedder in the kge model is

(_entity_embedder): LookupEmbedder( (_embeddings): Embedding(14541, 201) (dropout): Dropout(p=0.3, inplace=False) )

This is really weird. And I tried with some other score functions such as distmult, transe and they seem to be fine. Do you have an idea why this happens for conve?

Thanks,

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/uma-pi1/kge/issues/239, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABEWXZHGKMNEUXS2VLRIKRTUI5XO3ANCNFSM5GZJEMYQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

jwzhi commented 3 years ago

I see. This clarifies a lot. Thank you!