Skip to contents

Wrapper function to generate PaCMAP parameters

Usage

params_pacmap(
  n_near = 10L,
  n_mid_near = 5L,
  n_further = 20L,
  init = c("pca", "random"),
  optimiser = c("adam_parallel", "adam"),
  lr = 1,
  n_epochs = NULL,
  beta1 = 0.9,
  beta2 = 0.999,
  eps = 1e-07,
  phase1_end = NULL,
  phase2_end = NULL
)

Arguments

n_near

Integer. Near pairs per point (attractive). The kNN search runs n_near + 50 wide and the pairs are the best of those by locally scaled distance. Defaults to 10L.

n_mid_near

Integer. Mid-near pairs per point. Each one is the second closest of six random points. Defaults to 5L.

n_further

Integer. Further (random) pairs per point. These exclude the near pairs. Defaults to 20L.

init

String. Embedding initialisation. "pca" uses the PC scores times 0.01, so the ratio between the components survives. One of c("pca", "random"). Defaults to "pca".

optimiser

String. The optimiser. One of c("adam_parallel", "adam"). Defaults to "adam_parallel".

lr

Numeric. Adam learning rate. Defaults to 1.0.

n_epochs

Integer or NULL. Total optimisation epochs. If NULL, resolved downstream to 450. Defaults to NULL.

beta1

Numeric. Adam first moment decay. Defaults to 0.9.

beta2

Numeric. Adam second moment decay. Defaults to 0.999.

eps

Numeric. Adam numerical stability constant. Defaults to 1e-07.

phase1_end

Integer or NULL. Epoch at which phase 1 ends. If NULL, resolved downstream to 100. Defaults to NULL.

phase2_end

Integer or NULL. Epoch at which phase 2 ends. If NULL, resolved downstream to 200. Defaults to NULL.

Value

A named list with the following elements:

  • n_near - Integer. Near pairs per point (attractive). The kNN search runs n_near + 50 wide and the pairs are the best of those by locally scaled distance. Defaults to 10L.

  • n_mid_near - Integer. Mid-near pairs per point. Each one is the second closest of six random points. Defaults to 5L.

  • n_further - Integer. Further (random) pairs per point. These exclude the near pairs. Defaults to 20L.

  • init - String. Embedding initialisation. "pca" uses the PC scores times 0.01, so the ratio between the components survives. One of c("pca", "random"). Defaults to "pca".

  • optimiser - String. The optimiser. One of c("adam_parallel", "adam"). Defaults to "adam_parallel".

  • lr - Numeric. Adam learning rate. Defaults to 1.0.

  • n_epochs - Integer or NULL. Total optimisation epochs. If NULL, resolved downstream to 450. Defaults to NULL.

  • beta1 - Numeric. Adam first moment decay. Defaults to 0.9.

  • beta2 - Numeric. Adam second moment decay. Defaults to 0.999.

  • eps - Numeric. Adam numerical stability constant. Defaults to 1e-07.

  • phase1_end - Integer or NULL. Epoch at which phase 1 ends. If NULL, resolved downstream to 100. Defaults to NULL.

  • phase2_end - Integer or NULL. Epoch at which phase 2 ends. If NULL, resolved downstream to 200. Defaults to NULL.

Examples

params_pacmap()
#> $n_near
#> [1] 10
#> 
#> $n_mid_near
#> [1] 5
#> 
#> $n_further
#> [1] 20
#> 
#> $init
#> [1] "pca"
#> 
#> $optimiser
#> [1] "adam_parallel"
#> 
#> $lr
#> [1] 1
#> 
#> $n_epochs
#> NULL
#> 
#> $beta1
#> [1] 0.9
#> 
#> $beta2
#> [1] 0.999
#> 
#> $eps
#> [1] 1e-07
#> 
#> $phase1_end
#> NULL
#> 
#> $phase2_end
#> NULL
#> 
params_pacmap(n_near = 15L, n_further = 30L)
#> $n_near
#> [1] 15
#> 
#> $n_mid_near
#> [1] 5
#> 
#> $n_further
#> [1] 30
#> 
#> $init
#> [1] "pca"
#> 
#> $optimiser
#> [1] "adam_parallel"
#> 
#> $lr
#> [1] 1
#> 
#> $n_epochs
#> NULL
#> 
#> $beta1
#> [1] 0.9
#> 
#> $beta2
#> [1] 0.999
#> 
#> $eps
#> [1] 1e-07
#> 
#> $phase1_end
#> NULL
#> 
#> $phase2_end
#> NULL
#>