jAER project on SourceForge

ch.unizh.ini.jaer.projects.topology
Class TopologyTracker

java.lang.Object
  extended by net.sf.jaer.eventprocessing.EventFilter
      extended by net.sf.jaer.eventprocessing.EventFilter2D
          extended by ch.unizh.ini.jaer.projects.topology.TopologyTracker
All Implemented Interfaces:
java.util.Observer

public class TopologyTracker
extends EventFilter2D
implements java.util.Observer

Learns neighborhood pixel topology based on event timing. When this filter runs, it starts with random connections between the input addresses and the the output. Temporal correlation between incoming events gradually maps neighbors to neighbors, resulting in a (hopefully) coherent output map after a while.

Author:
Matthias Schrag, Kynan Eng, Tobi Delbruck

Nested Class Summary
 class TopologyTracker.Monitor
          The Monitor class.
 
Field Summary
protected static float[] BELL_CURVE
           
protected static int BELL_CURVE_RESOLUTION
           
protected static float BELL_CURVE_SIZE
           
protected static int BUFFER_SIZE
           
protected static float DEFAULT_LEARNING_WINDOW_CENTER
           
protected static float DEFAULT_LEARNING_WINDOW_STANDARD_DEVIATION
           
protected static int DEFAULT_MAX_SQUARED_NEIGHBORHOOD_DISTANCE
           
protected static int DEFAULT_NEIGHBORHOOD_SIZE
           
protected  int eventIndex
           
protected  int[] eventsSource
          The event window with fixed events count windowSize.
protected  int[] eventsTimestamp
           
protected  byte[] eventsType
           
protected  int eventWindowBegin
           
protected  int eventWindowEnd
           
protected  boolean inhibit2ndOrderNeighbors
           
protected static float INITIAL_WEIGHT
           
protected  float learningWindowBegin
           
protected  float learningWindowEnd
           
protected  float learningWindowMean
           
protected  int learningWindowShape
          Algorithm parameters.
protected  float learningWindowStandardDeviation
           
protected  int maxSquaredNeighborDistance
          Monitor parameters.
protected  int maxX
           
protected  int maxY
           
protected  int minX
           
protected  int minY
           
protected  TopologyTracker.Monitor monitor
          The monitor and stat data.
protected  int neighborhoodSize
           
protected  int[][] neighbors
           
protected static int NO_LABEL
           
protected static int NO_TIMESTAMP
           
protected static byte NO_TYPE
           
protected  long numEventsProcessed
           
protected  boolean onResetWriteStatsAndExit
           
protected  java.util.Vector<java.lang.String> params
           
protected  float reinforcement
           
protected  boolean showFalseEdges
           
protected  boolean showStatus
           
protected  int sizeX
          Event source data structures.
protected  int sizeY
          Event source data structures.
protected  long startTime
           
protected  java.util.Vector<java.lang.String> stat
           
protected  boolean symmetricPlasticityChange
           
protected  java.util.ArrayList<java.lang.Float> utilizationStat
           
protected  float[][] weights
          Algorithm data structures.
protected  javax.swing.JFrame window
           
 
Fields inherited from class net.sf.jaer.eventprocessing.EventFilter2D
enclosedFilter, out
 
Fields inherited from class net.sf.jaer.eventprocessing.EventFilter
annotationEnabled, chip, enclosedFilterChain, filterEnabled, log, perf, propertyTooltipMap, support
 
Constructor Summary
TopologyTracker(AEChip chip)
          Create a new TopologyTracker
 
Method Summary
 EventPacket<?> filterPacket(EventPacket<?> in)
          Core method: add new events to queue, learn topology
static java.lang.String getDescription()
           
 java.lang.Object getFilterState()
          Deprecated. - no one uses this
 boolean getIgnoreReset()
           
 boolean getInhibit2ndOrderNeighbors()
           
 float getLearningWindowMean()
           
 int getLearningWindowShape()
           
 float getLearningWindowStandardDeviation()
           
 int getMaxSize()
           
 int getNeighborhoodSize()
           
 float getReinforcement()
           
 boolean getSymmetricPlasticityChange()
           
 void initFilter()
          this should allocate and initialize memory: it may be called when the chip e.g.
 boolean isLearningEnabled()
           
 boolean isMapEventsToLearnedTopologyEnabled()
           
 boolean isOnResetWriteStatsAndExit()
           
 boolean isShowFalseEdges()
           
 boolean isShowStatus()
           
 void resetFilter()
          should reallyDoReset the filter to initial state
 void setFilterEnabled(boolean yes)
          Resets the filter
 void setIgnoreReset(boolean value)
           
 void setInhibit2ndOrderNeighbors(boolean value)
           
 void setLearningEnabled(boolean learningEnabled)
           
 void setLearningWindowMean(float value)
           
 void setLearningWindowShape(int value)
           
 void setLearningWindowStandardDeviation(float value)
           
 void setMapEventsToLearnedTopologyEnabled(boolean mapEventsToLearnedTopologyEnabled)
           
 void setMaxSize(int maxSize)
           
 void setNeighborhoodSize(int value)
           
 void setOnResetWriteStatsAndExit(boolean value)
           
 void setReinforcement(float value)
           
 void setShowFalseEdges(boolean value)
           
 void setShowStatus(boolean value)
           
 void setSymmetricPlasticityChange(boolean value)
           
 void update(java.util.Observable o, java.lang.Object arg)
           
protected  void updateLearningWindow()
          Calculates the learning window begin and end.
 
Methods inherited from class net.sf.jaer.eventprocessing.EventFilter2D
checkOutputPacketEventType, checkOutputPacketEventType, getEnclosedFilter, resetOut, setEnclosedFilter
 
Methods inherited from class net.sf.jaer.eventprocessing.EventFilter
getChip, getEnclosedFilterChain, getEnclosingFilter, getPrefs, getPropertyChangeSupport, getPropertyTooltip, isAnnotationEnabled, isEnclosed, isFilterEnabled, prefsEnabledKey, setAnnotationEnabled, setChip, setEnclosed, setEnclosedFilter, setEnclosedFilterChain, setEnclosingFilter, setPreferredEnabledState, setPrefs, setPropertyTooltip
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_NEIGHBORHOOD_SIZE

protected static final int DEFAULT_NEIGHBORHOOD_SIZE
See Also:
Constant Field Values

DEFAULT_MAX_SQUARED_NEIGHBORHOOD_DISTANCE

protected static final int DEFAULT_MAX_SQUARED_NEIGHBORHOOD_DISTANCE
See Also:
Constant Field Values

DEFAULT_LEARNING_WINDOW_CENTER

protected static final float DEFAULT_LEARNING_WINDOW_CENTER
See Also:
Constant Field Values

DEFAULT_LEARNING_WINDOW_STANDARD_DEVIATION

protected static final float DEFAULT_LEARNING_WINDOW_STANDARD_DEVIATION
See Also:
Constant Field Values

BUFFER_SIZE

protected static final int BUFFER_SIZE
See Also:
Constant Field Values

NO_LABEL

protected static final int NO_LABEL
See Also:
Constant Field Values

NO_TIMESTAMP

protected static final int NO_TIMESTAMP
See Also:
Constant Field Values

NO_TYPE

protected static final byte NO_TYPE
See Also:
Constant Field Values

INITIAL_WEIGHT

protected static final float INITIAL_WEIGHT
See Also:
Constant Field Values

BELL_CURVE_SIZE

protected static final float BELL_CURVE_SIZE
See Also:
Constant Field Values

BELL_CURVE_RESOLUTION

protected static final int BELL_CURVE_RESOLUTION
See Also:
Constant Field Values

BELL_CURVE

protected static final float[] BELL_CURVE

sizeX

protected int sizeX
Event source data structures.


sizeY

protected int sizeY
Event source data structures.


minX

protected int minX

minY

protected int minY

maxX

protected int maxX

maxY

protected int maxY

eventsSource

protected int[] eventsSource
The event window with fixed events count windowSize. An event consists of its source and timestamp, both stored in simultaneous arrays. eventsIndex denotes the index of the numEventsProcessed event.


eventsTimestamp

protected int[] eventsTimestamp

eventsType

protected byte[] eventsType

eventWindowBegin

protected int eventWindowBegin

eventWindowEnd

protected int eventWindowEnd

eventIndex

protected int eventIndex

numEventsProcessed

protected long numEventsProcessed

learningWindowShape

protected int learningWindowShape
Algorithm parameters.


learningWindowMean

protected float learningWindowMean

learningWindowStandardDeviation

protected float learningWindowStandardDeviation

neighborhoodSize

protected int neighborhoodSize

inhibit2ndOrderNeighbors

protected boolean inhibit2ndOrderNeighbors

symmetricPlasticityChange

protected boolean symmetricPlasticityChange

reinforcement

protected float reinforcement

maxSquaredNeighborDistance

protected int maxSquaredNeighborDistance
Monitor parameters.


showStatus

protected boolean showStatus

showFalseEdges

protected boolean showFalseEdges

onResetWriteStatsAndExit

protected boolean onResetWriteStatsAndExit

weights

protected float[][] weights
Algorithm data structures.


neighbors

protected int[][] neighbors

learningWindowBegin

protected float learningWindowBegin

learningWindowEnd

protected float learningWindowEnd

monitor

protected TopologyTracker.Monitor monitor
The monitor and stat data.


params

protected java.util.Vector<java.lang.String> params

stat

protected java.util.Vector<java.lang.String> stat

utilizationStat

protected java.util.ArrayList<java.lang.Float> utilizationStat

startTime

protected long startTime

window

protected javax.swing.JFrame window
Constructor Detail

TopologyTracker

public TopologyTracker(AEChip chip)
Create a new TopologyTracker

Method Detail

getDescription

public static java.lang.String getDescription()

setFilterEnabled

public void setFilterEnabled(boolean yes)
Description copied from class: EventFilter2D
Resets the filter

Overrides:
setFilterEnabled in class EventFilter2D
Parameters:
yes - true to reset
See Also:
EventFilter.setPreferredEnabledState()

initFilter

public void initFilter()
Description copied from class: EventFilter
this should allocate and initialize memory: it may be called when the chip e.g. size parameters are changed after creation of the filter

Specified by:
initFilter in class EventFilter

resetFilter

public void resetFilter()
should reallyDoReset the filter to initial state

Specified by:
resetFilter in class EventFilter

getFilterState

public java.lang.Object getFilterState()
Deprecated. - no one uses this

should return the filter state in some useful form

Specified by:
getFilterState in class EventFilter

updateLearningWindow

protected void updateLearningWindow()
Calculates the learning window begin and end.


filterPacket

public EventPacket<?> filterPacket(EventPacket<?> in)
Core method: add new events to queue, learn topology

Specified by:
filterPacket in class EventFilter2D
Parameters:
in - the input packet
Returns:
the output packet

getNeighborhoodSize

public int getNeighborhoodSize()

setNeighborhoodSize

public void setNeighborhoodSize(int value)

getLearningWindowShape

public int getLearningWindowShape()

setLearningWindowShape

public void setLearningWindowShape(int value)

getLearningWindowMean

public float getLearningWindowMean()

setLearningWindowMean

public void setLearningWindowMean(float value)

getLearningWindowStandardDeviation

public float getLearningWindowStandardDeviation()

setLearningWindowStandardDeviation

public void setLearningWindowStandardDeviation(float value)

getInhibit2ndOrderNeighbors

public boolean getInhibit2ndOrderNeighbors()

setInhibit2ndOrderNeighbors

public void setInhibit2ndOrderNeighbors(boolean value)

getSymmetricPlasticityChange

public boolean getSymmetricPlasticityChange()

setSymmetricPlasticityChange

public void setSymmetricPlasticityChange(boolean value)

getReinforcement

public float getReinforcement()

setIgnoreReset

public void setIgnoreReset(boolean value)

getIgnoreReset

public boolean getIgnoreReset()

setReinforcement

public void setReinforcement(float value)

isShowStatus

public boolean isShowStatus()

setShowStatus

public void setShowStatus(boolean value)

isShowFalseEdges

public boolean isShowFalseEdges()

setShowFalseEdges

public void setShowFalseEdges(boolean value)

isOnResetWriteStatsAndExit

public boolean isOnResetWriteStatsAndExit()

setOnResetWriteStatsAndExit

public void setOnResetWriteStatsAndExit(boolean value)

update

public void update(java.util.Observable o,
                   java.lang.Object arg)
Specified by:
update in interface java.util.Observer

isMapEventsToLearnedTopologyEnabled

public boolean isMapEventsToLearnedTopologyEnabled()

setMapEventsToLearnedTopologyEnabled

public void setMapEventsToLearnedTopologyEnabled(boolean mapEventsToLearnedTopologyEnabled)

isLearningEnabled

public boolean isLearningEnabled()

setLearningEnabled

public void setLearningEnabled(boolean learningEnabled)

getMaxSize

public int getMaxSize()

setMaxSize

public void setMaxSize(int maxSize)

jAER project on SourceForge