library(bigMap)
# source graph plot
source('../graphs.R')

Load data

load('../s3d.RData')

Run ptSNE

# script: 
library(bigMap)
# 
load('./s3d$data')
ppx.list <- round(nrow(s3d$data) *c(.005, .01, .05, .1, .2, .3, .4, .5, .6, .7, .8, .9, .95, .99), 0)
#
g.list <- lapply(ppx.list, function(ppx) {
  g <- bdm.init(s3d$data, is.distance = T, ppx = ppx, threads = 4)
  g <- bdm.ptsne(s3d$data, g, theta = .0, threads = 1, layers = 1)
  g <- bdm.knp(s3d$data, g, threads = 4)
  g <- bdm.hlCorr(s3d$data, g, threads = 4)
  g
})
#
save(g.list, file = './glist.RData')

Embedding cost/size function

nulL <- lapply(g.list, function(g) bdm.cost(g))

Output

nulL <- lapply(g.list, function(g) graph.plot(g, s3d$edges))

hl-Correlation

hlTable <- sapply(g.list, function(g) summary(g$hlC)[4])
hlTable <- matrix(round(hlTable, 4), nrow = 1)
colnames(hlTable) <- sapply(g.list, function(g) g$ppx$ppx)
rownames(hlTable) <- c('<hlC>')
knitr::kable(hlTable, caption = 'hl-Correlation') %>%
  kable_styling(full_width = F)
hl-Correlation
10 20 102 205 410 615 820 1025 1230 1435 1640 1845 1948 2030
<hlC> 0.0685 0.0399 0.5477 0.6025 0.6656 0.7268 0.7391 0.74 0.746 0.7444 0.7795 0.7452 0.7501 0.7512

Kary-neighborhood preservation

bdm.knp.plot(g.list)

Running Times

rTimes <- sapply(g.list, function(g) c(g$ppx$t[3], g$t$epoch, g$t$ptsne[3], (g$ppx$t[3] +g$t$ptsne[3])))
rTimes <- round(rTimes, 1)
colnames(rTimes) <- sapply(g.list, function(g) g$ppx$ppx)
rownames(rTimes) <- c('betas', 'epoch', 'pt-SNE', 'total')
knitr::kable(rTimes, caption = 'Computation times (s)') %>%
  kable_styling(full_width = F)
Computation times (s)
10 20 102 205 410 615 820 1025 1230 1435 1640 1845 1948 2030
betas 0.1 0.1 0.2 0.2 0.4 0.6 0.8 0.6 0.6 0.6 0.6 0.6 0.8 0.6
epoch 0.9 0.9 1.1 1.3 1.8 2.3 2.4 2.4 2.4 2.4 2.4 2.4 2.4 2.4
pt-SNE 26.7 27.2 33.0 40.3 54.6 68.3 72.6 72.5 72.5 72.7 72.6 72.6 72.6 71.9
total 26.8 27.3 33.2 40.6 55.0 68.8 73.4 73.1 73.1 73.3 73.3 73.2 73.3 72.5

Run on: Intel(R) Xeon(R) CPU E31225 @ 3.10GHz, 4 cores, 16GB RAM.