SOMRd:
Filter:
sc3-plugins/Classes (extension) | UGens > Analysis

SOMRd
ExtensionExtension

Map an input using a Self-Organising Map

Description

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

.kr

Arguments:

bufnum

A reference to the buffer containing the SOM.

inputdata

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

netsize

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

numdims

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

gate

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

Examples

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.