kohonen.kohonen.GrowingGas

class kohonen.kohonen.GrowingGas(params)[source]

A Growing Neural Gas uses a variable number of variable-topology neurons.

In essence, a GNG is similar to a standard Gas, but there is additional logic in this class for adding new neurons to better explain areas of the sample space that currently have large error.

Attributes

shape

Methods

distance_heatmap(cue[, axes, lower, upper]) Return an image representation of the distance to a cue.
distances(cue) Get the distance of each neuron in the Map to a particular cue.
flat_to_coords(i) Given a flattened index, convert it to a coordinate tuple.
learn(cue[, weights, distances]) Store a cue in the gas.
neighbors(i)
neuron(coords) Get the current state of a specific neuron.
neuron_heatmap([axes, lower, upper]) Return an image representation of this Map.
reset([f]) Reset the neurons and timeseries in the Map.
sample(n) Get a sample of n neuron coordinates from the map.
smallest(distances) Get the index of the smallest element in the given distances array.
weights(distances)
winner(cue) Get the coordinates of the most similar neuron to the given cue.
__init__(params)[source]

Initialize a new Growing Gas with parameters.

Methods

__init__(params) Initialize a new Growing Gas with parameters.
distance_heatmap(cue[, axes, lower, upper]) Return an image representation of the distance to a cue.
distances(cue) Get the distance of each neuron in the Map to a particular cue.
flat_to_coords(i) Given a flattened index, convert it to a coordinate tuple.
learn(cue[, weights, distances]) Store a cue in the gas.
neighbors(i)
neuron(coords) Get the current state of a specific neuron.
neuron_heatmap([axes, lower, upper]) Return an image representation of this Map.
reset([f]) Reset the neurons and timeseries in the Map.
sample(n) Get a sample of n neuron coordinates from the map.
smallest(distances) Get the index of the smallest element in the given distances array.
weights(distances)
winner(cue) Get the coordinates of the most similar neuron to the given cue.

Attributes

shape
learn(cue, weights=None, distances=None)[source]

Store a cue in the gas.

Related Topics

This Page