IntegerRawVisualCortex Class Reference

The Visual Cortex Class. More...

#include <Channels/IntegerRawVisualCortex.H>

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

List of all members.

Public Member Functions

virtual Image< float > getOutput ()
 Overload to not only convert to float but also apply our output factor.
virtual void saveResults (const nub::ref< FrameOstream > &ofs)
 Save our results.
Constructors/Destructor

 IntegerRawVisualCortex (OptionManager &mgr, nub::ref< IntegerMathEngine > eng, const std::string &descrName="Integer Visual Cortex", const std::string &tagName="IntegerRawVisualCortex")
 Construct with no channel; channels must then be added with addSubChan().
virtual ~IntegerRawVisualCortex ()
 Virtual destructor for safe inheritance.

Protected Member Functions

virtual void doInputInt (const IntegerInput &inp, const SimTime &t, PyramidCache< int > *cache, const Image< byte > &clipMask)
virtual Image< int > combineOutputsInt ()
 Combine the outputs of our subchannels.
virtual Image< int > getChannelOutputMap (IntegerChannel &chan) const
 get weighted (but not resized) channel output map
virtual Image< int > postProcessOutputMap (const Image< int > &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< std::stringitsLogFile
 text log file name
OModelParam< MaxNormTypeitsNormType
 maxNormalization to use
OModelParam< bool > itsUseRandom
 add random noise to 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 > itsSaveOutput
 save our output?
OModelParam< bool > itsUseMax
 use max across features instead of sum?

Detailed Description

The Visual Cortex Class.

In brief, IntegerRawVisualCortex holds a collection of IntegerChannel objects, and most of IntegerRawVisualCortex's operations are achieved by some kind of iteration over that collection. That is, IntegerRawVisualCortex now does little work by itself, but delegates its operations to the channels, accumulating their results if necessary.

Definition at line 79 of file IntegerRawVisualCortex.H.


Constructor & Destructor Documentation

IntegerRawVisualCortex::IntegerRawVisualCortex ( OptionManager mgr,
nub::ref< IntegerMathEngine eng,
const std::string descrName = "Integer Visual Cortex",
const std::string tagName = "IntegerRawVisualCortex" 
)

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 72 of file IntegerRawVisualCortex.C.

IntegerRawVisualCortex::~IntegerRawVisualCortex (  )  [virtual]

Virtual destructor for safe inheritance.

Definition at line 91 of file IntegerRawVisualCortex.C.


Member Function Documentation

Image< int > IntegerRawVisualCortex::combineOutputsInt (  )  [protected, virtual]
Image< int > IntegerRawVisualCortex::getChannelOutputMap ( IntegerChannel chan  )  const [protected, virtual]
Image< float > IntegerRawVisualCortex::getOutput (  )  [virtual]

Overload to not only convert to float but also apply our output factor.

Reimplemented from IntegerComplexChannel.

Definition at line 301 of file IntegerRawVisualCortex.C.

References getMinMax(), OModelParam< T >::getVal(), and itsOutputFactor.

void IntegerRawVisualCortex::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.

Definition at line 315 of file IntegerRawVisualCortex.C.

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

Image< int > IntegerRawVisualCortex::postProcessOutputMap ( const Image< int > &  outmap  )  [protected, virtual]

post-process raw weighted sum of channel output maps

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

Definition at line 188 of file IntegerRawVisualCortex.C.

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

Referenced by combineOutputsInt().

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

stop

Reimplemented from IntegerComplexChannel.

Definition at line 112 of file IntegerRawVisualCortex.C.


Member Data Documentation

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

Definition at line 159 of file IntegerRawVisualCortex.H.

Referenced by combineOutputsInt().

text log file name

Definition at line 133 of file IntegerRawVisualCortex.H.

maxNormalization to use

Reimplemented from IntegerComplexChannel.

Definition at line 134 of file IntegerRawVisualCortex.H.

Referenced by postProcessOutputMap().

output range factor

Definition at line 136 of file IntegerRawVisualCortex.H.

Referenced by getOutput().

save our output?

Definition at line 160 of file IntegerRawVisualCortex.H.

Referenced by saveResults().

use max across features instead of sum?

Definition at line 161 of file IntegerRawVisualCortex.H.

Referenced by combineOutputsInt().

use old version? see Visualcortex.H

Reimplemented from IntegerComplexChannel.

Definition at line 156 of file IntegerRawVisualCortex.H.

Referenced by getChannelOutputMap().

add random noise to output

Definition at line 135 of file IntegerRawVisualCortex.H.


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