Learn R Programming

gmum.r (version 0.2.1)

GNG: Constructor of GrowingNeuralGas object.

Description

Construct GNG object. Can be used to train offline, or online.

Usage

GNG(x = NULL, labels = c(), beta = 0.99, alpha = 0.5, max.nodes = 1000, eps.n = 6e-04, eps.w = 0.05, max.edge.age = 200, train.online = FALSE, max.iter = 200, dim = -1, min.improvement = 0.001, lambda = 200, verbosity = 0, seed = -1, k = NULL)

Arguments

x
Passed data (matrix of data.frame) for offline training
labels
Every example can be associated with labels that are added to nodes later. By default empty
beta
Decrease the error variables of all node nodes by this fraction (forgetting rate). Default 0.99
alpha
Decrease the error variables of the nodes neighboring to the newly inserted node by this fraction. Default 0.5
max.nodes
Maximum number of nodes (after reaching this size it will continue running, but won't add new nodes)
eps.n
How strongly adapt neighbour node. Default 0.0006
eps.w
How strongly adapt winning node. Default 0.05
max.edge.age
Maximum edge age. Decrease to increase speed of change of graph topology. Default 200
train.online
default FALSE. If used will run in online fashion
max.iter
Uf training offline will stop if exceedes max.iter iterations. Default 200
dim
Used for training online, specifies training example size
min.improvement
Used for offline (default) training. Controls stopping criterion, decrease if training stops too early. Default 1e-3
lambda
Every lambda iteration is added new vertex. Default 200
verbosity
How verbose should the process be, as integer from $[0,6]$, default: 0
seed
Seed for internal randomization
k
Utility constant, by default turned off. Good value is 1.3. Constant controlling speed of erasing obsolete nodes, see http://sund.de/netze/applets/gng/full/tex/DemoGNG/node20.html

Examples

Run this code
## Not run: 
# X <- gng.preset.sphere(100)
# y <- round(runif(100))
# # Train in an offline manner
# gng <- GNG(X, labels=y, max.nodes=20)
# # Plot
# plot(gng)
# 
# # Train in an online manner with utility (erasing obsolete nodes)
# gng <- GNG(max.nodes=20, train.online=TRUE, k=1.3, dim=3)
# insertExamples(gng, X, labels=y)
# run(gng)
# Sys.sleep(10)
# terminate(gng)
# # Plot
# plot(gng)
# ## End(Not run)

Run the code above in your browser using DataLab