lenskit.graphs.lightgcn.LightGCNConfig#

classlenskit.graphs.lightgcn.LightGCNConfig#

Bases: lenskit.config.common.EmbeddingSizeMixin, pydantic.BaseModel

Configuration for LightGCNScorer.

Stability:

Experimental

embedding_size:pydantic.PositiveInt=16#

The dimension of the embedding space (number of latent features). Seems to work best as a power of 2.

layer_count:pydantic.PositiveInt=2#

The number of layers to use.

layer_blend:pydantic.PositiveFloat|list [pydantic.PositiveFloat]|None =None#

The blending coefficient(s) for layer blending. This is equivalent to alpha in LightGCN.

batch_size:pydantic.PositiveInt=4096#

The training batch size.

learning_rate:pydantic.PositiveFloat=0.01#

The learning rate for training.

epochs:pydantic.PositiveInt=10#

The number of training epochs.

regularization:pydantic.PositiveFloat|None =0.01#

The regularization strength.

loss:Literal['logistic','pairwise']='pairwise'#

The loss to use for model training.

pairwise

BPR pairwise ranking loss, using LightGCN.recommend_loss().

logistic

Logistic link prediction loss, using LightGCN.link_pred_loss().

check_layer_blending()#
Return type:

Self