kohonen.kohonen.Gas

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

A neural Gas is a topologically unordered collection of neurons.

Learning takes place in the Gas by ordering the neurons according to their distance from each cue that is presented. Neurons are updated using this sorted order, with an exponentially decreasing weight for neurons that are further (in sort order) from the cue.

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]) Add a new cue vector to the Map, moving neurons as needed.
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 this Gas. A Gas must have a 1D shape.

Methods

__init__(params) Initialize this Gas.
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]) Add a new cue vector to the Map, moving neurons as needed.
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

Related Topics

This Page