Classes (extension) | UGens > Analysis

SOMRd : MultiOutUGen : UGen : AbstractFunction : Object

Map an input using a Self-Organising Map


Once you have created a self-organising map using SOMTrain, you can query it using SOMRd. This UGen takes an input vector (i.e. multichannel input) and outputs the co-ordinate of the best-matching node in the SOM, i.e. the node which is closest to the input vector (using Euclidean distance). It can run at control- or audio-rate.

For some applications you might want to retrieve the best-matching template vector, i.e. the spatial location of the best-matching node, rather than just its index in the net. You can use SOMRd.coordsToBufIndex(coords, netsize) to find which Buffer frame contains that vector, and then use BufRd to pull the vector out. See examples...

Class Methods, inputdata, netsize: 10, numdims: 2, gate: 1)



A reference to the buffer containing the SOM.


An Array of the input signals for the net to map.


The size of the neural net along one dimension. Must match what you trained it with.


The dimensionality of the neural net. Choose from 1, 2, 3, or 4. Must match what you trained it with.


A simple on-or-off control. When off (gate<=0) the incoming data is ignored (output stays constant).

Inherited class methods

Undocumented class methods, inputdata, netsize: 10, numdims: 2, gate: 1)

SOMRd.bufIndexToCoords(bufindex, netsize: 10, numdims: 3)

SOMRd.coordsToBufIndex(coords, netsize: 10)

Instance Methods

Inherited instance methods


Here we'll assume you have a SOM trained as in the example from the SOMTrain helpfile, i.e. it's stored in variable ~som, with ~numnodes nodes, and a 1D net trained on 2D input data.