
#include <Neuro/VisualCortex.H>
Inheritance diagram for VisualCortex:


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::string > | itsLogFile |
| text log file name | |
| OModelParam< MaxNormType > | itsNormType |
| 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< LevelSpec > | itsLevelSpec |
| LevelSpec used by our channels, used to compute output dims. | |
| OModelParam< bool > | itsSaveWinnerFeatures |
| Save vector of features at each attended location? | |
| OModelParam< std::string > | itsSaveOutTo |
| save our outputs to MGZ file? | |
| OModelParam< std::string > | itsLoadOutFrom |
| load outputs from MGZ file? | |
|
||||||||||||||||
|
Construct with no channel; channels must then be added with addSubChan().
Definition at line 95 of file VisualCortex.C. References GVX_TRACE. |
|
|
Virtual destructor for safe inheritance.
Definition at line 117 of file VisualCortex.C. References GVX_TRACE. |
|
|
|
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. |
|
|
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(). |
|
|
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(). |
|
|
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(). |
|
|
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(). |
|
|
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(). |
|
|
Save our internals.
Reimplemented from ModelComponent. Reimplemented in VisualCortexEyeMvt. Definition at line 420 of file VisualCortex.C. References saveResults(). |
|
|
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(). |
|
|
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(). |
|
|
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(). |
|
|
LevelSpec used by our channels, used to compute output dims.
Definition at line 176 of file VisualCortex.H. Referenced by combineOutputs(), and doInput(). |
|
|
load outputs from MGZ file?
Definition at line 182 of file VisualCortex.H. Referenced by combineOutputs(), doInput(), and start1(). |
|
|
text log file name
Definition at line 149 of file VisualCortex.H. Referenced by evolve(). |
|
|
maxNormalization to use
Reimplemented from ComplexChannel. Definition at line 150 of file VisualCortex.H. Referenced by VisualCortexSurprise::postProcessOutputMap(), and postProcessOutputMap(). |
|
|
output range factor
Definition at line 153 of file VisualCortex.H. Referenced by combineOutputs(), and VisualCortexEyeMvt::getOutput(). |
|
|
save our output?
Definition at line 152 of file VisualCortex.H. Referenced by VisualCortexEyeMvt::saveResults(), and saveResults(). |
|
|
save our outputs to MGZ file?
Definition at line 181 of file VisualCortex.H. Referenced by combineOutputs(), and start1(). |
|
|
Save vector of features at each attended location?
Definition at line 179 of file VisualCortex.H. Referenced by evolve(). |
|
|
use old version? see Visualcortex.H
Reimplemented from ComplexChannel. Definition at line 173 of file VisualCortex.H. Referenced by getChannelOutputMap(). |
|
|
add random noise to output
Definition at line 151 of file VisualCortex.H. Referenced by combineOutputs(). |
1.4.4