KGEmbeddingOptions

Options & Configuration · AiDotNet.RetrievalAugmentedGeneration.Graph.Embeddings

Configuration options for training knowledge graph embedding models.

For Beginners

These settings control how the model learns. The defaults work well for most knowledge graphs, but you can tune them for better performance:

  • EmbeddingDimension: Larger = more expressive but slower to train
  • Epochs: More = better fit but risk of overfitting
  • LearningRate: How fast the model updates (too high = unstable, too low = slow)
  • NegativeSamples: Corrupted triples generated per real triple for contrast

How It Works

These options control the training process for all KG embedding models (TransE, RotatE, ComplEx, DistMult). All values use nullable types with industry-standard defaults applied internally when null.

Constructors

Constructor Summary
KGEmbeddingOptions()

Properties

Property Summary
double? L2Regularization { get; set; } L2 regularization coefficient.
double? LearningRate { get; set; } Learning rate for SGD updates.
double? Margin { get; set; } Margin for margin-based ranking loss (used by TransE and RotatE).
int? BatchSize { get; set; } Mini-batch size for stochastic gradient descent.
int? EmbeddingDimension { get; set; } Dimensionality of entity and relation embedding vectors.
int? Epochs { get; set; } Number of training epochs (full passes over all triples).
int? NegativeSamples { get; set; } Number of negative (corrupted) samples per positive triple.
int? NumTimeBins { get; set; } Number of time bins for temporal embedding models (TemporalTransE).
int? Seed { get; set; } Random seed for reproducibility.