Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

VisualCortex Class Reference

#include <Neuro/VisualCortex.H>

Inheritance diagram for VisualCortex:

Inheritance graph
[legend]
Collaboration diagram for VisualCortex:

Collaboration graph
[legend]
List of all members.

Detailed Description

The Visual Cortex Class.

In brief, VisualCortex holds a collection of ChannelBase objects, and most of VisualCortex's operations are achieved by some kind of iteration over that collection. That is, VisualCortex now does little work by itself, but delegates its operations to the channels, accumulating their results if necessary. NOTE: VisualCortex has a virtual ModelComponent base which is shared among its inheritance from ModelComponent via the ComplexChannel inheritance path, and its inheritance from ModelComponent via its SimModule inheritance path. Just beware!

Definition at line 77 of file VisualCortex.H.

Public Member Functions

virtual void evolve (SimEventQueue &q)
 Evolve one timestep; default implementation is a no-op.
virtual void saveResults (const nub::ref< FrameOstream > &ofs)
 save1() will call saveResults, for compat with Channels
const Image< float > getVCOutput (const Image< PixRGB< byte > > &rgbin)
 Get the output of the vc map from a given image.
Constructors/Destructor
 VisualCortex (OptionManager &mgr, const std::string &descrName="Visual Cortex", const std::string &tagName="VisualCortex")
 Construct with no channel; channels must then be added with addSubChan().
virtual ~VisualCortex ()
 Virtual destructor for safe inheritance.
Channel management functions
These functions offer an interface in which VisualCortex maintains a set of channels, each of which can be looked up either by an integer index or by an associated name.

void addDefaultChannels (const VisualCortexWeights &wts)
 Adds the default channels to the VisualCortex object.

Protected Member Functions

virtual void doInput (const InputFrame &inframe)
 Implementation of ChannelBase input() functions.
virtual Image< float > combineOutputs ()
 Combine the outputs of our subchannels.
virtual Image< float > getChannelOutputMap (const uint idx) const
 get weighted (but not resized) channel output map
virtual Image< float > postProcessOutputMap (const Image< float > &outmap)
 post-process raw weighted sum of channel output maps
virtual void start1 ()
 start
virtual void stop2 ()
 stop
virtual void save1 (const ModelComponentSaveInfo &sinfo)
 Save our internals.

Protected Attributes

OModelParam< std::stringitsLogFile
 text log file name
OModelParam< MaxNormTypeitsNormType
 maxNormalization to use
OModelParam< bool > itsUseRandom
 add random noise to output
OModelParam< bool > itsSaveOutput
 save our output?
OModelParam< float > itsOutputFactor
 output range factor
OModelParam< bool > itsUseOlderVersion
 use old version? see Visualcortex.H
OModelParam< LevelSpecitsLevelSpec
 LevelSpec used by our channels, used to compute output dims.
OModelParam< bool > itsSaveWinnerFeatures
 Save vector of features at each attended location?
OModelParam< std::stringitsSaveOutTo
 save our outputs to MGZ file?
OModelParam< std::stringitsLoadOutFrom
 load outputs from MGZ file?


Constructor & Destructor Documentation

VisualCortex::VisualCortex OptionManager mgr,
const std::string descrName = "Visual Cortex",
const std::string tagName = "VisualCortex"
 

Construct with no channel; channels must then be added with addSubChan().

Parameters:
mgr our ModelManager (see ModelManager.H)
descrName descriptive name for human usage
tagName name for ParamMap usage

Definition at line 95 of file VisualCortex.C.

References GVX_TRACE.

VisualCortex::~VisualCortex  )  [virtual]
 

Virtual destructor for safe inheritance.

Definition at line 117 of file VisualCortex.C.

References GVX_TRACE.


Member Function Documentation

void VisualCortex::addDefaultChannels const VisualCortexWeights wts  ) 
 

Adds the default channels to the VisualCortex object.

The total channel weights are given here for each channel. If any weight is <= 0.0, the channel will NOT be added.

NOTE: There is no default argument here, even though a logical choice would be for VisualCortexWeights::ICOFM() to be the default; instead, this way, the fact that ICOFM is the default becomes explicit at the call site of addDefaultChannels(), and is not vulnerable to being changed if somebody later decided to change the default argument to addDefaultChannels().

Definition at line 201 of file VisualCortex.C.

References ComplexChannel::addSubChan(), VisualCortexWeights::chanContourw, VisualCortexWeights::chanCow, VisualCortexWeights::chanCw, VisualCortexWeights::chanDepthw, VisualCortexWeights::chanDw, VisualCortexWeights::chanEw, VisualCortexWeights::chanFw, VisualCortexWeights::chanGw, VisualCortexWeights::chanH2SVw, VisualCortexWeights::chanIBw, VisualCortexWeights::chanIw, VisualCortexWeights::chanLw, VisualCortexWeights::chanMw, VisualCortexWeights::chanObjDetw, VisualCortexWeights::chanOw, VisualCortexWeights::chanPedw, VisualCortexWeights::chanSHw, VisualCortexWeights::chanSIFTw, VisualCortexWeights::chanSoxw, VisualCortexWeights::chanTw, VisualCortexWeights::chanXw, VisualCortexWeights::chanZerow, ModelComponent::getManager(), GVX_TRACE, LERROR, LINFO, makeContourChannel(), makeSharedComp(), ComplexChannel::numChans(), and ComplexChannel::subChan().

Image< float > VisualCortex::combineOutputs  )  [protected, virtual]
 

Combine the outputs of our subchannels.

We do this in a slightly different way than the ComplexChannel base version.

Reimplemented from ComplexChannel.

Definition at line 560 of file VisualCortex.C.

References downSizeClean(), e, FLOAT_NORM_PRESERVE, getChannelOutputMap(), Image< T >::getDims(), ChannelBase::getInputDims(), getMinMax(), OModelParam< T >::getVal(), GVX_TRACE, Dims::h(), Image< T >::initialized(), inplaceAddBGnoise(), itsLevelSpec, itsLoadOutFrom, itsOutputFactor, itsSaveOutTo, itsUseRandom, LDEBUG, LINFO, LevelSpec::mapLevel(), MYLOGVERB, ComplexChannel::numChans(), output(), ComplexChannel::outputAvailable(), postProcessOutputMap(), sml, ComplexChannel::subChan(), Dims::w(), and ZEROS.

void VisualCortex::doInput const InputFrame inframe  )  [protected, virtual]
 

Implementation of ChannelBase input() functions.

Implements ChannelBase.

Reimplemented in VisualCortexEyeMvt.

Definition at line 519 of file VisualCortex.C.

References buildPyrGaussian(), featureHierarchyLevel(), featureHierarchyName(), rutz::shared_ptr< T >::get(), OModelParam< T >::getVal(), InputFrame::grayFloat(), itsLevelSpec, itsLoadOutFrom, LINFO, LevelSpec::maxDepth(), ComplexChannel::numChans(), InputFrame::pyrCache(), and ComplexChannel::subChan().

void VisualCortex::evolve SimEventQueue q  )  [virtual]
 

Evolve one timestep; default implementation is a no-op.

Implements SimModule.

Reimplemented in VisualCortexEyeMvt.

Definition at line 358 of file VisualCortex.C.

References ComplexChannel::accept(), SimEventQueue::check(), e, ee, ComplexChannel::getFeatures(), ComplexChannel::getOutput(), OModelParam< T >::getVal(), ChannelBase::input(), itsLogFile, itsSaveWinnerFeatures, ComplexChannel::numChans(), WTAwinner::p, SimEventQueue::post(), sformat(), WTAwinner::t, and textLog().

Image< float > VisualCortex::getChannelOutputMap const uint  idx  )  const [protected, virtual]
 

get weighted (but not resized) channel output map

Definition at line 445 of file VisualCortex.C.

References getMinMax(), OModelParam< T >::getVal(), itsUseOlderVersion, LDEBUG, MYLOGVERB, ComplexChannel::subChan(), and w.

Referenced by combineOutputs().

const Image< float > VisualCortex::getVCOutput const Image< PixRGB< byte > > &  rgbin  ) 
 

Get the output of the vc map from a given image.

Definition at line 405 of file VisualCortex.C.

References InputFrame::fromRgb(), ComplexChannel::getOutput(), ChannelBase::input(), SimTime::MSECS(), and SimTime::ZERO().

Image< float > VisualCortex::postProcessOutputMap const Image< float > &  outmap  )  [protected, virtual]
 

post-process raw weighted sum of channel output maps

Derived classes may overload this to provide custom post-processing. For example, VisualCortexSurprise may pass the output through a sigmoidal nonlinearity or spatial competition. Default implementation is to treat the special case of VCXNORM_LANDMARK.

Reimplemented in VisualCortexSurprise.

Definition at line 491 of file VisualCortex.C.

References OModelParam< T >::getVal(), itsNormType, LDEBUG, LFATAL, maxNormalize(), maxNormTypeName(), VCXNORM_LANDMARK, VCXNORM_NONE, and VCXNORM_SURPRISE.

Referenced by combineOutputs().

void VisualCortex::save1 const ModelComponentSaveInfo sinfo  )  [protected, virtual]
 

Save our internals.

Reimplemented from ModelComponent.

Reimplemented in VisualCortexEyeMvt.

Definition at line 420 of file VisualCortex.C.

References saveResults().

void VisualCortex::saveResults const nub::ref< FrameOstream > &  ofs  )  [virtual]
 

save1() will call saveResults, for compat with Channels

Reimplemented from ComplexChannel.

Reimplemented in VisualCortexEyeMvt.

Definition at line 431 of file VisualCortex.C.

References FLOAT_NORM_PRESERVE, ComplexChannel::getOutput(), OModelParam< T >::getVal(), GVX_TRACE, itsSaveOutput, ComplexChannel::numChans(), SRC_POS, and ComplexChannel::subChan().

Referenced by save1().

void VisualCortex::start1  )  [protected, virtual]
 

start

Reimplemented from ComplexChannel.

Reimplemented in VisualCortexEyeMvt.

Definition at line 160 of file VisualCortex.C.

References featureHierarchyLevel(), featureHierarchyName(), featureName(), OModelParam< T >::getVal(), GVX_TRACE, itsLoadOutFrom, itsSaveOutTo, LINFO, rutz::make_shared(), ComplexChannel::numChans(), ModelComponent::start1(), ComplexChannel::start1(), and ComplexChannel::subChan().

void VisualCortex::stop2  )  [protected, virtual]
 

stop

Reimplemented from ComplexChannel.

Definition at line 190 of file VisualCortex.C.

References GVX_TRACE, rutz::shared_ptr< T >::is_valid(), ModelComponent::stop2(), and ComplexChannel::stop2().


Member Data Documentation

OModelParam<LevelSpec> VisualCortex::itsLevelSpec [protected]
 

LevelSpec used by our channels, used to compute output dims.

Definition at line 176 of file VisualCortex.H.

Referenced by combineOutputs(), and doInput().

OModelParam<std::string> VisualCortex::itsLoadOutFrom [protected]
 

load outputs from MGZ file?

Definition at line 182 of file VisualCortex.H.

Referenced by combineOutputs(), doInput(), and start1().

OModelParam<std::string> VisualCortex::itsLogFile [protected]
 

text log file name

Definition at line 149 of file VisualCortex.H.

Referenced by evolve().

OModelParam<MaxNormType> VisualCortex::itsNormType [protected]
 

maxNormalization to use

Reimplemented from ComplexChannel.

Definition at line 150 of file VisualCortex.H.

Referenced by VisualCortexSurprise::postProcessOutputMap(), and postProcessOutputMap().

OModelParam<float> VisualCortex::itsOutputFactor [protected]
 

output range factor

Definition at line 153 of file VisualCortex.H.

Referenced by combineOutputs(), and VisualCortexEyeMvt::getOutput().

OModelParam<bool> VisualCortex::itsSaveOutput [protected]
 

save our output?

Definition at line 152 of file VisualCortex.H.

Referenced by VisualCortexEyeMvt::saveResults(), and saveResults().

OModelParam<std::string> VisualCortex::itsSaveOutTo [protected]
 

save our outputs to MGZ file?

Definition at line 181 of file VisualCortex.H.

Referenced by combineOutputs(), and start1().

OModelParam<bool> VisualCortex::itsSaveWinnerFeatures [protected]
 

Save vector of features at each attended location?

Definition at line 179 of file VisualCortex.H.

Referenced by evolve().

OModelParam<bool> VisualCortex::itsUseOlderVersion [protected]
 

use old version? see Visualcortex.H

Reimplemented from ComplexChannel.

Definition at line 173 of file VisualCortex.H.

Referenced by getChannelOutputMap().

OModelParam<bool> VisualCortex::itsUseRandom [protected]
 

add random noise to output

Definition at line 151 of file VisualCortex.H.

Referenced by combineOutputs().


The documentation for this class was generated from the following files:
Generated on Fri Oct 10 10:47:49 2008 for iLab Neuromorphic Vision Toolkit by  doxygen 1.4.4