PetaVision  Alpha
PV::NormalizeMax Class Reference
Inheritance diagram for PV::NormalizeMax:
PV::NormalizeMultiply PV::NormalizeBase PV::BaseObject PV::CheckpointerDataInterface PV::Observer

Public Member Functions

 NormalizeMax (const char *name, HyPerCol *hc)
int addConnToList (HyPerConn *newConn)
virtual int communicateInitInfo (CommunicateInitInfoMessage const *message) override
bool getDataStructuresAllocatedFlag ()
std::string const & getDescription () const
char const * getDescription_c () const
bool getInitialValuesSetFlag ()
bool getInitInfoCommunicatedFlag ()
char const * getKeyword () const
MPIBlock const * getMPIBlock ()
const char * getName ()
char const * getName () const
bool getNormalizeArborsIndividuallyFlag () const
float getNormalizeCutoff ()
bool getNormalizeFromPostPerspectiveFlag ()
float getRMinX ()
float getRMinY ()
float getStrength () const
virtual void ioParam_nonnegativeConstraintFlag (enum ParamsIOFlag ioFlag)
virtual void ioParam_normalize_cutoff (enum ParamsIOFlag ioFlag)
virtual void ioParam_normalizeFromPostPerspective (enum ParamsIOFlag ioFlag)
virtual void ioParam_rMinX (enum ParamsIOFlag ioFlag)
virtual void ioParam_rMinY (enum ParamsIOFlag ioFlag)
virtual int ioParamsFillGroup (enum ParamsIOFlag ioFlag) override
bool isUsingGPU () const
virtual int normalizeWeights () override
int normalizeWeightsWrapper ()
virtual int registerData (Checkpointer *checkpointer)
virtual int respond (std::shared_ptr< BaseMessage const > message) override

Protected Member Functions

int accumulateMax (float *dataPatchStart, int weights_in_patch, float *max)
int accumulateMaxAbs (float *dataPatchStart, int weights_in_patch, float *max)
int accumulateMin (float *dataPatchStart, int weights_in_patch, float *max)
int accumulateSum (float *dataPatchStart, int weights_in_patch, float *sum)
int accumulateSumShrunken (float *dataPatchStart, float *sum, int nxpShrunken, int nypShrunken, int offsetShrunken, int xPatchStride, int yPatchStride)
int accumulateSumSquared (float *dataPatchStart, int weights_in_patch, float *sumsq)
int accumulateSumSquaredShrunken (float *dataPatchStart, float *sumsq, int nxpShrunken, int nypShrunken, int offsetShrunken, int xPatchStride, int yPatchStride)
virtual int allocateDataStructures ()
int applyRMin (float *dataPatchStart, float rMinX, float rMinY, int nxp, int nyp, int xPatchStride, int yPatchStride)
int applyThreshold (float *dataPatchStart, int weights_in_patch, float wMax)
virtual int cleanup ()
virtual int copyInitialStateToGPU ()
int initialize (const char *name, HyPerCol *hc)
virtual int initializeState ()
virtual void ioParam_minMaxTolerated (enum ParamsIOFlag ioFlag)
virtual void ioParam_normalizeArborsIndividually (enum ParamsIOFlag ioFlag)
virtual void ioParam_normalizeOnInitialize (enum ParamsIOFlag ioFlag)
virtual void ioParam_normalizeOnWeightUpdate (enum ParamsIOFlag ioFlag)
virtual void ioParam_strength (enum ParamsIOFlag ioFlag)
virtual int prepareCheckpointWrite ()
virtual int processCheckpointRead ()
virtual int readStateFromCheckpoint (Checkpointer *checkpointer) override
int respondAllocateData (AllocateDataMessage const *message)
int respondCleanup (CleanupMessage const *message)
int respondCommunicateInitInfo (CommunicateInitInfoMessage const *message)
int respondCopyInitialStateToGPUMessage (CopyInitialStateToGPUMessage const *message)
int respondInitializeState (InitializeStateMessage const *message)
int respondPrepareCheckpointWrite (PrepareCheckpointWriteMessage const *message)
int respondProcessCheckpointRead (ProcessCheckpointReadMessage const *message)
int respondReadStateFromCheckpoint (ReadStateFromCheckpointMessage< Checkpointer > const *message)
int respondRegisterData (RegisterDataMessage< Checkpointer > const *message)
void setDataStructuresAllocatedFlag ()
virtual int setDescription () override
void setInitialValuesSetFlag ()
void setInitInfoCommunicatedFlag ()
int setName (char const *name)
int setParent (HyPerCol *hc)

Static Protected Member Functions

static void normalizePatch (float *dataStart, int weights_per_patch, float multiplier)

Protected Attributes

std::vector< HyPerConn * > connectionList
std::string description
bool mDataStructuresAllocatedFlag = false
bool mInitialValuesSetFlag = false
bool mInitInfoCommunicatedFlag = false
float minMaxTolerated
bool mUsingGPUFlag = false
char * name = nullptr
bool nonnegativeConstraintFlag
float normalize_cutoff
bool normalizeArborsIndividually
bool normalizeFromPostPerspective
bool normalizeOnInitialize
bool normalizeOnWeightUpdate
HyPerColparent = nullptr
float rMinX
float rMinY
float strength

Private Member Functions

int initialize_base ()

Detailed Description

Definition at line 15 of file NormalizeMax.hpp.

Member Function Documentation

int PV::NormalizeBase::addConnToList ( HyPerConn newConn)

Appends the indicated connection to the list of connections for this normalizer

Definition at line 237 of file NormalizeBase.cpp.

int PV::NormalizeMultiply::applyRMin ( float *  dataPatchStart,
float  rMinX,
float  rMinY,
int  nxp,
int  nyp,
int  xPatchStride,
int  yPatchStride 

Zeroes out all weights in a rectangle defined by the member variables rMinX, rMinY. dataPatchStart is a pointer to a patch. nxp and nyp are the dimensions of the patch xPatchStride, yPatchStride are the strides in the x- and y-directions. nfp is implicitly the same as xPatchStride rMinX and rMinY are the half-width and half-height of the rectangle to be zeroed out. The rectangle to be zeroed out is centered at the center of the patch. Pixels in the interior of the rectangle are set to zero, but pixels exactly on the edge of the rectangle are not changed.

Definition at line 234 of file NormalizeMultiply.cpp.

int PV::NormalizeMultiply::applyThreshold ( float *  dataPatchStart,
int  weights_in_patch,
float  wMax 

Sets all weights in a patch whose absolute value is below a certain value, to zero dataPatchStart is a pointer to a buffer of weights weights_in_patch is the number of weights in the dataPatchStart buffer wMax defines the threshold. If |w| < wMax * normalize_cutoff, the weight will be zeroed.

Definition at line 219 of file NormalizeMultiply.cpp.

int PV::NormalizeBase::communicateInitInfo ( CommunicateInitInfoMessage const *  message)

Called by HyPerConn::communicateInitInfo this virtual method is where settings that depend on other objects take place. In particular, NormalizeGroup calls its group head's addConnToList method from NormalizeGroup::communicateInitInfo method.

Reimplemented from PV::BaseObject.

Reimplemented in PV::NormalizeGroup.

Definition at line 88 of file NormalizeBase.cpp.

bool PV::BaseObject::getDataStructuresAllocatedFlag ( )

Get-method for mDataStructuresAllocatedFlag, which is false on initialization and then becomes true once setDataStructuresAllocatedFlag() is called.

Definition at line 65 of file BaseObject.hpp.

bool PV::BaseObject::getInitialValuesSetFlag ( )

Get-method for mInitialValuesSetFlag, which is false on initialization and then becomes true once setInitialValuesSetFlag() is called.

Definition at line 71 of file BaseObject.hpp.

bool PV::BaseObject::getInitInfoCommunicatedFlag ( )

Get-method for mInitInfoCommunicatedFlag, which is false on initialization and then becomes true once setInitInfoCommunicatedFlag() is called.

Definition at line 58 of file BaseObject.hpp.

void PV::NormalizeMultiply::ioParam_nonnegativeConstraintFlag ( enum ParamsIOFlag  ioFlag)

If set to true, negative weights are replaced by zero

Definition at line 51 of file NormalizeMultiply.cpp.

void PV::NormalizeMultiply::ioParam_normalize_cutoff ( enum ParamsIOFlag  ioFlag)

If positive, all weights whose absolute value is less than (normalize_cutoff * (max weight over all patches and all arbors)) are set to zero. The maximum weight is calculated after applying the behavior defined by rMinX, rMinY and nonnegativeConstraintFlag.

Definition at line 60 of file NormalizeMultiply.cpp.

void PV::NormalizeMultiply::ioParam_normalizeFromPostPerspective ( enum ParamsIOFlag  ioFlag)

If set to true, the weights are accumulated based on the index of the post-synaptic neuron. If false, the index of the pre-synaptic neuron is used.

Reimplemented in PV::NormalizeGap.

Definition at line 65 of file NormalizeMultiply.cpp.

void PV::NormalizeMultiply::ioParam_rMinX ( enum ParamsIOFlag  ioFlag)

Sets the size in the x-direction of the rectangle zeroed out by applyRMin

Definition at line 43 of file NormalizeMultiply.cpp.

void PV::NormalizeMultiply::ioParam_rMinY ( enum ParamsIOFlag  ioFlag)

Sets the size in the y-direction of the rectangle zeroed out by applyRMin

Definition at line 47 of file NormalizeMultiply.cpp.

bool PV::BaseObject::isUsingGPU ( ) const

Returns true if the object requires the GPU; false otherwise. HyPerCol will not initialize the GPU unless one of the objects in its hierarchy returns true

Definition at line 79 of file BaseObject.hpp.

int PV::NormalizeBase::normalizeWeightsWrapper ( )

The public interface for normalizing weights. If normalizeOnInitialize is true and the simulation time is startTime(), or if normalizeOnWeightUpdate is true and the simulation time is the conn's lastUpdateTime, it calls the (virtual protected) method normalizeWeights

Definition at line 95 of file NormalizeBase.cpp.

void PV::BaseObject::setDataStructuresAllocatedFlag ( )

This method sets mDataStructuresAllocatedFlag to true.

Definition at line 111 of file BaseObject.hpp.

void PV::BaseObject::setInitialValuesSetFlag ( )

This method sets the flag returned by getInitialValuesSetFlag to true.

Definition at line 116 of file BaseObject.hpp.

void PV::BaseObject::setInitInfoCommunicatedFlag ( )

This method sets mInitInfoCommunicatedFlag to true.

Definition at line 106 of file BaseObject.hpp.

The documentation for this class was generated from the following files: