make2dPlot: Plotting 2-dimension plot for the poincare embeddings.

Description Usage Arguments Value Examples

View source: R/illustration.R

Description

This function gives a 2 dimension plot with entity names and line segments between the entities with positive relation.

Usage

1
make2dPlot(theta, nameOfSample, POS, N_epoch, lr, n_neg)

Arguments

theta

- A N x 2 matrix. Each of the column corresponds to the entity subject to embed.

nameOfSample

- Name of the entity subject to embed.

POS

- A 2-row positive relation matrix that contains positive relation entities columnwisely.

N_epoch

- The number of epochs.

lr

- The learning rate.

n_neg

- The number of negative samples for each iteration.

Value

A 2-dimension plot with entity names and line segments between the entities with positive relation.

Examples

1
2
3
4
5
toy_yaml <- yaml::yaml.load(toy)
toy_tree <- data.tree::as.Node(toy_yaml)
toy_dataset <- dataLoader(toy_tree)
emb <- poincareEmbeddings(toy_tree, 2, 100, 0.001, 5)
make2dPlot(emb$theta, toy_dataset$entity, toy_dataset$POS, 100, 0.001, 5)

hwchang1201/poincare.embeddings documentation built on Dec. 9, 2019, 1:30 p.m.