The standard attention gate. More...
#include <Neuro/AttentionGate.H>
Public Member Functions | |
AttentionGateStd (OptionManager &mgr, const std::string &descrName="Task-Relevance Map Std", const std::string &tagName="AttentionGateStd") | |
Uninitialized constructor. | |
virtual | ~AttentionGateStd () |
Destructor. | |
virtual void | reset1 () |
Reset to initial state just after construction. | |
Protected Member Functions | |
SIMCALLBACK_DECLARE (AttentionGateStd, SimEventInputFrame) | |
Callback for input frames. | |
SIMCALLBACK_DECLARE (AttentionGateStd, SimEventAttentionGuidanceMapOutput) | |
Callback for AGM. | |
SIMCALLBACK_DECLARE (AttentionGateStd, SimEventSaveOutput) | |
Callback for every time we should save our outputs. | |
virtual void | computeMinMaxXY (const Image< float > &attentionMap, const Image< int > &segments, const Image< bool > &candidates) |
Compute for objects the max surprise location and value. | |
virtual void | extractFeatureValues (SimEventQueue &q) |
extract features from the surprising locations | |
virtual void | computeFeatureDistance () |
Find the feature distance between objects. | |
virtual Image< float > | getLastAttentionMap () const |
virtual Image< float > | getCurrentAttentionMap () const |
virtual Image< float > | getValue (SimEventQueue &q) |
Return all our values as an Image<float> |
The standard attention gate.
This is our current standard AG implementation.
Definition at line 187 of file AttentionGate.H.
AttentionGateStd::AttentionGateStd | ( | OptionManager & | mgr, | |
const std::string & | descrName = "Task-Relevance Map Std" , |
|||
const std::string & | tagName = "AttentionGateStd" | |||
) |
Uninitialized constructor.
Definition at line 145 of file AttentionGate.C.
AttentionGateStd::~AttentionGateStd | ( | ) | [virtual] |
Destructor.
Definition at line 163 of file AttentionGate.C.
void AttentionGateStd::computeFeatureDistance | ( | ) | [protected, virtual] |
Find the feature distance between objects.
For each object in each frame, compute its feature distance from all other objects using a standard sum of squares distance.
Definition at line 653 of file AttentionGate.C.
References Image< T >::beginw(), Image< T >::resize(), and sqrt().
void AttentionGateStd::computeMinMaxXY | ( | const Image< float > & | attentionMap, | |
const Image< int > & | segments, | |||
const Image< bool > & | candidates | |||
) | [protected, virtual] |
Compute for objects the max surprise location and value.
For each potential object, find the most surprising region, its value and store its ID from segmentImageMC2. This will then be used in later methods to extract features from the objects.
Definition at line 455 of file AttentionGate.C.
References Image< T >::begin(), Image< T >::end(), and Image< T >::getWidth().
void AttentionGateStd::extractFeatureValues | ( | SimEventQueue & | q | ) | [protected, virtual] |
extract features from the surprising locations
For each segmented object, take the most surprising location and extract the features. When done store the objects and features in a deque. Each element in the deque corresponds to one frame
Definition at line 509 of file AttentionGate.C.
References Image< T >::getHeight(), Image< T >::getVal(), Image< T >::getWidth(), and SimEventQueue::request().
Image< float > AttentionGateStd::getValue | ( | SimEventQueue & | q | ) | [protected, virtual] |
Return all our values as an Image<float>
Definition at line 300 of file AttentionGate.C.
References OModelParam< T >::getVal().
void AttentionGateStd::reset1 | ( | ) | [virtual] |
Reset to initial state just after construction.
Reimplemented from ModelComponent.
Definition at line 289 of file AttentionGate.C.
References Image< T >::freeMem(), and OModelParam< T >::getVal().
AttentionGateStd::SIMCALLBACK_DECLARE | ( | AttentionGateStd | , | |
SimEventSaveOutput | ||||
) | [protected] |
Callback for every time we should save our outputs.
AttentionGateStd::SIMCALLBACK_DECLARE | ( | AttentionGateStd | , | |
SimEventAttentionGuidanceMapOutput | ||||
) | [protected] |
Callback for AGM.
AttentionGateStd::SIMCALLBACK_DECLARE | ( | AttentionGateStd | , | |
SimEventInputFrame | ||||
) | [protected] |
Callback for input frames.