if(require(torch) && torch::torch_is_installed() && require(uwot))
{
library(torch)
library(topicmodels.etm)
library(uwot)
path <- system.file(package = "topicmodels.etm", "example", "example_etm.ckpt")
model <- torch_load(path)
n_epochs <- NULL
# \dontshow{
n_epochs <- 5
# }
overview <- summary(model,
metric = "cosine", n_neighbors = 15, n_epochs = n_epochs,
fast_sgd = FALSE, n_threads = 1, verbose = TRUE)
overview$center
overview$embed_2d
# \dontshow{
}
# End of main if statement running only if the torch is properly installed
# }
Run the code above in your browser using DataLab