RawVisualCortex Class Reference

The Visual Cortex Class. More...

#include <Channels/RawVisualCortex.H>

Inheritance diagram for RawVisualCortex:
Inheritance graph
[legend]
Collaboration diagram for RawVisualCortex:
Collaboration graph
[legend]

List of all members.

Public Member Functions

virtual void saveResults (const nub::ref< FrameOstream > &ofs)
 Save our results.
const Image< float > getVCOutput (const Image< PixRGB< byte > > &rgbin)
 Get the output of the vc map from a given image.
Constructors/Destructor

 RawVisualCortex (OptionManager &mgr, const std::string &descrName="Raw Visual Cortex", const std::string &tagName="RawVisualCortex")
 Construct with no channel; channels must then be added with addSubChan().
virtual ~RawVisualCortex ()
 Virtual destructor for safe inheritance.

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 paramChanged (ModelParamBase *const param, const bool valueChanged, ParamClient::ChangeStatus *status)
 Called whenever a ModelParamBase has its value changed.
virtual void start1 ()
 start
virtual void stop2 ()
 stop

Protected Attributes

OModelParam< std::stringitsType
OModelParam< MaxNormTypeitsNormType
 maxNormalization to use
OModelParam< bool > itsUseRandom
 add random noise to output
OModelParam< float > itsOutputFactor
 output range factor
OModelParam< float > itsNoise
 output noise range
OModelParam< bool > itsUseOlderVersion
 use old version? see Visualcortex.H
OModelParam< LevelSpecitsLevelSpec
 LevelSpec used by our channels, used to compute output dims.
OModelParam< std::stringitsSaveOutTo
 save our outputs to MGZ file?
OModelParam< std::stringitsLoadOutFrom
 load outputs from MGZ file?
OModelParam< bool > itsSaveOutput
 save our output?
OModelParam< bool > itsUseMax
 use max across features instead of sum?
OModelParam< float > itsWeightThresh
 threshold on channel total weights for last round of maxnorm

Detailed Description

The Visual Cortex Class.

In brief, RawVisualCortex holds a collection of ChannelBase objects, and most of RawVisualCortex's operations are achieved by some kind of iteration over that collection. That is, RawVisualCortex now does little work by itself, but delegates its operations to the channels, accumulating their results if necessary. NOTE: RawVisualCortex 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 69 of file RawVisualCortex.H.


Constructor & Destructor Documentation

RawVisualCortex::RawVisualCortex ( OptionManager mgr,
const std::string descrName = "Raw Visual Cortex",
const std::string tagName = "RawVisualCortex" 
)

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 103 of file RawVisualCortex.C.

RawVisualCortex::~RawVisualCortex (  )  [virtual]

Virtual destructor for safe inheritance.

Definition at line 127 of file RawVisualCortex.C.


Member Function Documentation

Image< float > RawVisualCortex::combineOutputs (  )  [protected, virtual]
void RawVisualCortex::doInput ( const InputFrame inframe  )  [protected, virtual]
Image< float > RawVisualCortex::getChannelOutputMap ( const uint  idx  )  const [protected, virtual]

get weighted (but not resized) channel output map

Definition at line 419 of file RawVisualCortex.C.

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

Referenced by combineOutputs().

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

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

Definition at line 404 of file RawVisualCortex.C.

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

void RawVisualCortex::paramChanged ( ModelParamBase *const   param,
const bool  valueChanged,
ParamClient::ChangeStatus status 
) [protected, virtual]

Called whenever a ModelParamBase has its value changed.

Subclasses of ModelComponent should override this function if they need to do any internal reconfiguration when their parameters change value (whether due to a command-line option, or a setModelParamString(), or a readParamsFrom()). See OrientationChannel::paramChanged() in Channels/OrientationChannel.C for an example; also see SaccadeControllerConfigurator::paramChanged() in Neuro/SaccadeControllers.C for for how to use this to select subcomponents at runtime.

Parameters:
param the address of the ModelParamBase that changed; subclasses can compare this with the addresses of their model param members to figure out which is the relevant param
valueChanged true if the value actually changed, false if the value was "set" but the new value is the same as the old value; some clients may want to avoid re-doing expensive operations if the value did not actually change
status the subclass that implements paramChanged() should set *status to CHANGE_REJECTED if it wishes to reject a particular parameter change; the caller of paramChanged() is expected to set *status to CHANGE_ACCEPTED prior to calling paramChanged(), so the implentation of paramChanged() does not need to set *status CHANGE_ACCEPTED if it wishes to allow the change since that will already be the default status

HISTORICAL NOTE: In the past, subclasses would override setModelParamString() for this same purpose, but in the new setup, setModelParamString() is NOT virtual and hence should not be (cannot be) overridden by subclasses. This setup is cleaner (and potentially more efficient) because subclasses don't have to compare string names to figure out which param changed; instead they are passed the address of the param itself. Furthermore, the new setup is more robust, since we can handle param value changes that come from any source (e.g., setModelParamVal(), or ModelParamBase::setValString(), or OModelParam::setVal()), and not just those that come through setModelParamString().

Reimplemented from ModelComponent.

Reimplemented in VisualCortexSurprise.

Definition at line 205 of file RawVisualCortex.C.

References ComplexChannel::addSubChan(), ASSERT, ModelComponent::getManager(), OModelParam< T >::getVal(), ComplexChannel::hasSubChan(), makeContourChannel(), makeSharedComp(), MC_RECURSE, ComplexChannel::numChans(), ComplexChannel::removeAllSubChans(), and ComplexChannel::subChan().

Image< float > RawVisualCortex::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 465 of file RawVisualCortex.C.

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

Referenced by combineOutputs().

void RawVisualCortex::saveResults ( const nub::ref< FrameOstream > &  ofs  )  [virtual]
void RawVisualCortex::start1 (  )  [protected, virtual]
void RawVisualCortex::stop2 (  )  [protected, virtual]

stop

Reimplemented from ComplexChannel.

Definition at line 195 of file RawVisualCortex.C.

References rutz::shared_ptr< T >::is_valid().


Member Data Documentation

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

Definition at line 146 of file RawVisualCortex.H.

Referenced by combineOutputs(), and doInput().

load outputs from MGZ file?

Definition at line 149 of file RawVisualCortex.H.

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

output noise range

Definition at line 123 of file RawVisualCortex.H.

Referenced by combineOutputs().

maxNormalization to use

Reimplemented from ComplexChannel.

Definition at line 120 of file RawVisualCortex.H.

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

output range factor

Definition at line 122 of file RawVisualCortex.H.

Referenced by combineOutputs().

save our output?

Definition at line 150 of file RawVisualCortex.H.

Referenced by saveResults().

save our outputs to MGZ file?

Definition at line 148 of file RawVisualCortex.H.

Referenced by combineOutputs(), and start1().

use max across features instead of sum?

Definition at line 151 of file RawVisualCortex.H.

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

use old version? see Visualcortex.H

Reimplemented from ComplexChannel.

Definition at line 143 of file RawVisualCortex.H.

Referenced by getChannelOutputMap().

add random noise to output

Definition at line 121 of file RawVisualCortex.H.

Referenced by combineOutputs().

threshold on channel total weights for last round of maxnorm

Definition at line 152 of file RawVisualCortex.H.

Referenced by postProcessOutputMap().


The documentation for this class was generated from the following files:
Generated on Sun May 8 08:43:46 2011 for iLab Neuromorphic Vision Toolkit by  doxygen 1.6.3