Package pyrobot :: Package brain :: Module ravq :: Class RAVQ
[frames | no frames]

Class RAVQ

Known Subclasses:
ARAVQ

Implements RAVQ algorithm as described in Linaker and Niklasson.

Method Summary
  __init__(self, bufferSize, epsilon, delta, historySize)
  __str__(self)
To display ravq just call print <instance>.
  bufferString(self)
  distanceMap(self)
Calculate distance map.
  distanceMapAsString(self)
  getNewWinner(self)
Returns boolean depending on whether or not there is a new winner after the last call to input.
  getWinnerCount(self)
Returns the number of times the current winner has been the winner, ie.
  input(self, vec)
Drives the ravq.
  loadRAVQFromFile(self, filename)
  modelString(self)
  process(self)
The RAVQ Algorithm: 1.
  saveRAVQToFile(self, filename)
  setAddModels(self, value)
Allows the RAVQ to dynamically add model vectors.
  setMask(self, mask)
The mask serves to weight certain components of the inputs in the distance calculations.
  setModelVectorsDistance(self)
How close are the model vectors to the current inputs?...
  setMovingAverage(self)
Determine moving average.
  setMovingAverageDistance(self)
How close is the moving average to the current inputs?...
  setVerbosity(self, value)
Determines which print statements to call.
  updateModelVectors(self)
Update models vectors with moving average if the moving average is the best model of the inputs.
  updateWinner(self)
Calculate the current winner based on which model vector is closest to the moving average.

Method Details

__str__(self)
(Informal representation operator)

To display ravq just call print <instance>.

distanceMap(self)

Calculate distance map.

getNewWinner(self)

Returns boolean depending on whether or not there is a new
winner after the last call to input.

getWinnerCount(self)

Returns the number of times the current winner has been the
winner, ie. the number of consecutive calls to input where the
current winner has been the winner.

input(self, vec)

Drives the ravq. For most uses, the vector categorization
is as simple as calling ravq.input(vec) on all vec in the
dataset. Accessing the winning model vector (after the buffer
is full) can be done directly. Using the get commands after
calling input will return any information necessary from the
ravq.

process(self)

The RAVQ Algorithm:
1. Calculate the average vector of all inputs in the buffer.
2. Calculate the distance of the average from the set of inputs
in the buffer.
3. Calculate the distance of the model vectors from the inputs
in the buffer.
4. If distance in step 2 is small and distance in step 3 is large,
add current average to list of model vectors.
5. Calculate the winning model vector based on distance between
each model vector and the buffer list.
6. Update history.
---The metric used to calculate distance is described in
"Sensory Flow Segmentation Using a Resource Allocating
Vector Quantizer" by Fredrik Linaker and Lars Niklasson
(2000).---

setAddModels(self, value)

Allows the RAVQ to dynamically add model vectors.

setMask(self, mask)

The mask serves to weight certain components of the inputs in
the distance calculations.

setModelVectorsDistance(self)

How close are the model vectors to the current inputs?

setMovingAverage(self)

Determine moving average.

setMovingAverageDistance(self)

How close is the moving average to the current inputs?

setVerbosity(self, value)

Determines which print statements to call.
Debugging only.

updateModelVectors(self)

Update models vectors with moving average if the moving
average is the best model of the inputs.

updateWinner(self)

Calculate the current winner based on which model vector is
closest to the moving average.

Generated by Epydoc 2.1 on Mon Jul 25 01:39:26 2005 http://epydoc.sf.net