PetaVision  Alpha
PV::InitUniformWeights Class Reference

#include <InitUniformWeights.hpp>

Inheritance diagram for PV::InitUniformWeights:
PV::InitWeights PV::BaseObject PV::CheckpointerDataInterface PV::Observer

InitUniformWeights Parameters

List of parameters needed by InitUniformWeights class

virtual void ioParam_weightInit (enum ParamsIOFlag ioFlag)
 weightInit: The value of each weight.
virtual void ioParam_connectOnlySameFeatures (enum ParamsIOFlag ioFlag)
 connectOnlySameFeatures: If this flag is set to false, all weights are set to the weightInit value, regardless of pre- and post- feature. If the flag is set to true, the weights are zero unless the pre- and post- feature indices are the same.

InitWeights Parameters

List of parameters needed by InitWeights class

virtual void ioParam_initWeightsFile (enum ParamsIOFlag ioFlag)
 initWeightsFile: A path to a weight pvp file to use for initializing the weights, which overrides the usual method of initializing weights defined by the class being instantiated. If the weights file has fewer features than the connection being initialized, the weights file is used for the lower-indexed features and the calcWeights method is used for the rest. If null or empty, calcWeights() is used to initialize all the weights.
virtual void ioParam_useListOfArborFiles (enum ParamsIOFlag ioFlag)
 useListOfArborFiles: A flag that indicates whether the initWeightsFile contains a single weight pvp file, or a list of files to be used for several arbors. The files inthe list can themselves have multiple arbors; each file isloaded in turn until the number of arbors in the connection is reached.
virtual void ioParam_combineWeightFiles (enum ParamsIOFlag ioFlag)
 combineWeightFiles: A flag that indicates whether the initWeightsFile is a list of weight files that should be combined.
virtual void ioParam_numWeightFiles (enum ParamsIOFlag ioFlag)
 numWeightFiles: If combineWeightFiles is set, specifies the number of weight files in the list of files specified by initWeightsFile.

Public Member Functions

 InitUniformWeights (const char *name, HyPerCol *hc)
bool getConnectOnlySameFeatures () const
bool getDataStructuresAllocatedFlag ()
std::string const & getDescription () const
char const * getDescription_c () const
bool getInitialValuesSetFlag ()
bool getInitInfoCommunicatedFlag ()
char const * getKeyword () const
MPIBlock const * getMPIBlock ()
char const * getName () const
float getWeightInit () const
int initializeWeights (PVPatch ***patches, float **dataStart, double *timef=NULL)
virtual int ioParamsFillGroup (enum ParamsIOFlag ioFlag) override
bool isUsingGPU () const
virtual int registerData (Checkpointer *checkpointer)
virtual int respond (std::shared_ptr< BaseMessage const > message) override

Protected Member Functions

virtual int allocateDataStructures ()
float calcDelta (int post, float dPost, float distHeadPreUnits)
virtual void calcWeights (float *dataStart, int patchIndex, int arborId) override
virtual void calcWeights ()
float calcXDelta (int iPost)
float calcYDelta (int jPost)
virtual int cleanup ()
virtual int communicateInitInfo (CommunicateInitInfoMessage const *message) override
virtual int copyInitialStateToGPU ()
int initialize (const char *name, HyPerCol *hc)
virtual int initializeState ()
virtual int initRNGs (bool isKernel)
int kernelIndexCalculations (int patchIndex)
virtual int prepareCheckpointWrite ()
virtual int processCheckpointRead ()
void readCombinedWeightFiles (bool sharedWeights, float **dataStart, int numPatchesX, int numPatchesY, int numPatchesF, const char *fileOfWeightFiles, double *timestampPtr=nullptr)
void readListOfArborFiles (bool sharedWeights, float **dataStart, int numPatchesX, int numPatchesY, int numPatchesF, const char *listOfArborsFilename, double *timestampPtr=nullptr)
virtual int readStateFromCheckpoint (Checkpointer *checkpointer) override
void readWeightPvpFile (bool sharedWeights, float **dataStart, int numPatchesX, int numPatchesY, int numPatchesF, const char *weightPvpFile, int numArbors, double *timestampPtr=nullptr)
virtual int readWeights (bool sharedWeights, float **dataStart, int numPatchesX, int numPatchesY, int numPatchesF, const char *filename, double *timestampPtr=nullptr)
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)
virtual int zeroWeightsOutsideShrunkenPatch (PVPatch ***patches)

Protected Attributes

std::string description
HyPerConnmCallingConn = nullptr
bool mCombineWeightFiles = false
bool mDataStructuresAllocatedFlag = false
float mDxPost
float mDyPost
char * mFilename = nullptr
bool mInitialValuesSetFlag = false
bool mInitInfoCommunicatedFlag = false
int mNumWeightFiles = 1
HyPerLayermPostLayer = nullptr
HyPerLayermPreLayer = nullptr
bool mUseListOfArborFiles = false
bool mUsingGPUFlag = false
float mXDistHeadPreUnits
float mYDistHeadPreUnits
char * name = nullptr
HyPerColparent = nullptr

Private Member Functions

virtual int initialize_base ()
void uniformWeights (float *dataStart, float weightInit, int kf, bool connectOnlySameFeatures)

Private Attributes

bool mConnectOnlySameFeatures = false
float mWeightInit = 0.0f

Detailed Description

A weight initializer that sets each weight to the same value.

Definition at line 18 of file InitUniformWeights.hpp.

Member Function Documentation

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.

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.

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: