Description Usage Arguments Value Examples
View source: R/embeddingTrainer.R
This function performs optimization with respect to the objective function. Please refer to 'vignette' to find the equation for the objective function and detailed ideas(e.g. how to optimize).
1 2 | embeddingTrainer(POS, NEG, entity, theta_dim = 2, N_epoch = 100,
lr = 0.001, n_neg = 4)
|
POS |
- A 2-row positive relation matrix that contains positive relation entities columnwisely. |
NEG |
- A 2-row negative relation matrix that contains negative relation entities columnwisely. |
entity |
- A vector of all the entities in the tree-shape dataset. |
theta_dim |
- The dimension of the embedding space. |
N_epoch |
- The number of epochs. |
lr |
- The learning rate. |
n_neg |
- The number of negative samples for each iteration. |
A trained matrix theta.
1 2 3 4 | statistics_yaml <- yaml::yaml.load(statistics)
statistics_tree <- data.tree::as.Node(statistics_yaml)
dataset <- dataLoader(statistics_tree)
embeddingTrainer(dataset$POS, dataset$NEG, dataset$entity, 2, 100, 0.001, 5)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.