Train function for Somoclu

Description

A function call to Somoclu to train the Self Organizing Map.

Usage

1
2
3
4
5
6
Rsomoclu.train(input_data, nEpoch, nSomX, nSomY,
                     radius0, radiusN,
                     radiusCooling, scale0, scaleN,
                     scaleCooling,
                     kernelType, mapType, gridType, compactSupport,
                     neighborhood, stdCoeff, codebook)

Arguments

input_data

input data, matrix format

nEpoch

Maximum number of epochs

nSomX

Number of columns in map (size of SOM in direction x)

nSomY

Number of rows in map (size of SOM in direction y)

radius0

Start radius (default: half of the map in direction min(x,y))

radiusN

End radius (default: 1)

radiusCooling

Radius cooling strategy: linear or exponential (default: linear)

scale0

Starting learning rate (default: 1.0)

scaleN

Finishing learning rate (default: 0.01)

scaleCooling

Learning rate cooling strategy: linear or exponential (default: linear)

kernelType

Kernel type 0: Dense CPU 1: Dense GPU 2: Sparse CPU (default: 0)

mapType

Map type: planar or toroid (default: "planar")

gridType

Grid type: square or hexagonal (default: "rectangular")

compactSupport

Compact support for Gaussian neighborhood, (default:TRUE)

neighborhood

Neighborhood function: gaussian or bubble (default: "gaussian")

codebook

initial codebook, (default:NULL)

stdCoeff

The coefficient in the Gaussian neighborhood function exp(-||x-y||^2/(2*(coeff*radius)^2)), (default:0.5)

Value

a list including elements

codebook

the codebook

globalBmus

global Best Matching Unit matrix

uMatrix

uMatrix

Author(s)

Peter Wittek, Shichao Gao

References

Peter Wittek, Shi Chao Gao, Ik Soo Lim, Li Zhao (2015). Somoclu: An Efficient Parallel Library for Self-Organizing Maps. arXiv:1305.1422.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
library('Rsomoclu')
data_file <- system.file("data", "rgbs.txt.gz", package = 'Rsomoclu')
input_data <- read.table(data_file)
input_data <- data.matrix(input_data)
nSomX <- 50
nSomY <- 50
nEpoch <- 10
radius0 <- 0
radiusN <- 0
radiusCooling <- "linear"
scale0 <- 0
scaleN <- 0.01
scaleCooling <- "linear"
kernelType <- 0
mapType <- "planar"
gridType <- "rectangular"
compactSupport <- FALSE
codebook <- NULL
neighborhood <- "gaussian"
stdCoeff <- 0.5
res <- Rsomoclu.train(input_data, nEpoch, nSomX, nSomY,
                      radius0, radiusN,
                      radiusCooling, scale0, scaleN,
                      scaleCooling,
                      kernelType, mapType, gridType, compactSupport, neighborhood,
                      stdCoeff, codebook)
res$codebook
res$globalBmus
res$uMatrix
library('kohonen')
sommap = Rsomoclu.kohonen(input_data, res)

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.