gigl.experimental.knowledge_graph_embedding.lib.config.model#

Classes#

ModelConfig

Configuration for knowledge graph embedding model architecture.

Module Contents#

class gigl.experimental.knowledge_graph_embedding.lib.config.model.ModelConfig[source]#

Configuration for knowledge graph embedding model architecture.

Defines the structure and behavior of the embedding model used for link prediction in heterogeneous knowledge graphs.

node_embedding_dim[source]#

Dimensionality of node embeddings. Higher dimensions can capture more complex relationships but require more memory and computation. Defaults to 128.

Type:

int

embedding_similarity_type[source]#

Type of similarity function used to compute scores between node embeddings. Options include cosine similarity, dot product, etc. Defaults to SimilarityType.COSINE.

Type:

SimilarityType

src_operator[source]#

Transformation operator applied to source node embeddings before computing edge scores. Can be identity (no transformation) or learned operators. Defaults to OperatorType.IDENTITY.

Type:

OperatorType

dst_operator[source]#

Transformation operator applied to destination node embeddings before computing edge scores. Can be identity (no transformation) or learned operators. Defaults to OperatorType.IDENTITY.

Type:

OperatorType

training_sampling[source]#

Sampling configuration used during training phase. Populated at runtime from training config. Defaults to None.

Type:

Optional[SamplingConfig]

validation_sampling[source]#

Sampling configuration used during validation phase. Populated at runtime from validation config. Defaults to None.

Type:

Optional[SamplingConfig]

testing_sampling[source]#

Sampling configuration used during testing phase. Populated at runtime from testing config. Defaults to None.

Type:

Optional[SamplingConfig]

num_edge_types[source]#

Number of distinct edge types in the knowledge graph. Populated at runtime from graph metadata. Defaults to None.

Type:

Optional[int]

embeddings_config[source]#

TorchRec embedding configuration for sparse embeddings. Specifies embedding tables, sharding strategies, and optimization settings. Populated at runtime. Defaults to None.

Type:

Optional[List[torchrec.EmbeddingBagConfig]]

dst_operator: gigl.experimental.knowledge_graph_embedding.lib.model.types.OperatorType[source]#
embedding_similarity_type: gigl.experimental.knowledge_graph_embedding.lib.model.types.SimilarityType[source]#
embeddings_config: List[torchrec.EmbeddingBagConfig] | None = None[source]#
node_embedding_dim: int = 128[source]#
num_edge_types: int | None = None[source]#
src_operator: gigl.experimental.knowledge_graph_embedding.lib.model.types.OperatorType[source]#
testing_sampling: gigl.experimental.knowledge_graph_embedding.lib.config.sampling.SamplingConfig | None = None[source]#
training_sampling: gigl.experimental.knowledge_graph_embedding.lib.config.sampling.SamplingConfig | None = None[source]#
validation_sampling: gigl.experimental.knowledge_graph_embedding.lib.config.sampling.SamplingConfig | None = None[source]#