PetaVision
Alpha
|
#include <DependentPatchSize.hpp>
DependentPatchSize Parameters | |
List of parameters needed from the DependentPatchSize class | |
virtual void | ioParam_nxp (enum ParamsIOFlag ioFlag) override |
nxp: DependentPatchSize does not read the nxp parameter, but copies it from the original connection. | |
virtual void | ioParam_nyp (enum ParamsIOFlag ioFlag) override |
nyp: DependentPatchSize does not read the nyp parameter, but copies it from the original connection. | |
virtual void | ioParam_nfp (enum ParamsIOFlag ioFlag) override |
nfp: DependentPatchSize does not read the nfp parameter, but copies it from the original connection. | |
Public Member Functions | |
DependentPatchSize (char const *name, HyPerCol *hc) | |
ConnectionData * | getConnectionData () const |
bool | getDataStructuresAllocatedFlag () const |
std::string const & | getDescription () const |
char const * | getDescription_c () const |
bool | getInitialValuesSetFlag () const |
bool | getInitInfoCommunicatedFlag () const |
MPIBlock const * | getMPIBlock () |
char const * | getName () const |
std::string const & | getObjectType () const |
int | getPatchSizeF () const |
int | getPatchSizeX () const |
int | getPatchSizeY () const |
void | ioParams (enum ParamsIOFlag ioFlag, bool printHeader, bool printFooter) |
bool | isUsingGPU () const |
char const * | lookupKeyword () const |
void | readParams () |
virtual Response::Status | registerData (Checkpointer *checkpointer) |
virtual Response::Status | respond (std::shared_ptr< BaseMessage const > message) override |
virtual void | setObjectType () override |
void | writeParams () |
Static Public Member Functions | |
static int | calcPostPatchSize (int prePatchSize, int numNeuronsPre, int numNeuronsPost) |
Protected Member Functions | |
virtual Response::Status | allocateDataStructures () |
virtual Response::Status | cleanup () |
virtual Response::Status | communicateInitInfo (std::shared_ptr< CommunicateInitInfoMessage const > message) override |
If nfp was set to a negative number in params, set it here to the postsynaptic layer's nf. More... | |
virtual Response::Status | copyInitialStateToGPU () |
char const * | getOriginalConnName (std::map< std::string, Observer * > const hierarchy) const |
PatchSize * | getOriginalPatchSize (std::map< std::string, Observer * > const hierarchy, char const *originalConnName) const |
int | initialize (char const *name, HyPerCol *hc) |
virtual Response::Status | initializeState () |
virtual int | ioParamsFillGroup (enum ParamsIOFlag ioFlag) override |
virtual Response::Status | prepareCheckpointWrite () |
virtual Response::Status | processCheckpointRead () |
virtual Response::Status | readStateFromCheckpoint (Checkpointer *checkpointer) override |
Response::Status | respondAllocateData (std::shared_ptr< AllocateDataMessage const > message) |
Response::Status | respondCleanup (std::shared_ptr< CleanupMessage const > message) |
Response::Status | respondCommunicateInitInfo (std::shared_ptr< CommunicateInitInfoMessage const > message) |
Response::Status | respondCopyInitialStateToGPU (std::shared_ptr< CopyInitialStateToGPUMessage const > message) |
Response::Status | respondInitializeState (std::shared_ptr< InitializeStateMessage const > message) |
Response::Status | respondPrepareCheckpointWrite (std::shared_ptr< PrepareCheckpointWriteMessage const > message) |
Response::Status | respondProcessCheckpointRead (std::shared_ptr< ProcessCheckpointReadMessage const > message) |
Response::Status | respondReadStateFromCheckpoint (std::shared_ptr< ReadStateFromCheckpointMessage< Checkpointer > const > message) |
Response::Status | respondRegisterData (std::shared_ptr< RegisterDataMessage< Checkpointer > const > message) |
Response::Status | respondSetCudaDevice (std::shared_ptr< SetCudaDeviceMessage const > message) |
virtual Response::Status | setCudaDevice (std::shared_ptr< SetCudaDeviceMessage const > message) |
void | setDataStructuresAllocatedFlag () |
void | setDescription () |
void | setInitialValuesSetFlag () |
void | setInitInfoCommunicatedFlag () |
int | setName (char const *name) |
int | setParent (HyPerCol *hc) |
virtual void | setPatchSize (PatchSize *originalPatchSize) |
Protected Attributes | |
std::string | description |
ConnectionData * | mConnectionData = nullptr |
PVCuda::CudaDevice * | mCudaDevice = nullptr |
bool | mDataStructuresAllocatedFlag = false |
bool | mInitialValuesSetFlag = false |
bool | mInitInfoCommunicatedFlag = false |
std::string | mObjectType |
int | mPatchSizeF = -1 |
int | mPatchSizeX = 1 |
int | mPatchSizeY = 1 |
bool | mUsingGPUFlag = false |
bool | mWarnDefaultNfp = true |
char * | name = nullptr |
HyPerCol * | parent = nullptr |
A subclass of PatchSize, which retrieves nxp, nyp, and nfp from the connection named in an OriginalConnNameParam component, instead of reading them from params.
Definition at line 19 of file DependentPatchSize.hpp.
|
staticinherited |
Calculates the patch size from the postsynaptic perspective, given the patch size from the presynaptic perspective and the PVLayerLoc structs for the pre- and post-synaptic layers.
If numNeuronsPre == numNeuronsPost, the return value is prePatchSize.
If numNeuronsPre > numNeuronsPost, numNeuronsPre must be an integer multiple of numNeuronsPost. The return value is prePatchSize * (numNeuronsPre / numNeuronsPost);
If numNeuronsPre < numNeuronsPost, numNeuronsPost must be an integer multiple of numNeuronsPre, and prePatchSize must be in integer multiple of their quotient. The return value is the prePatchSize / (numNeuronsPost / numNeuronsPre).
Definition at line 101 of file PatchSize.cpp.
|
overrideprotectedvirtual |
If nfp was set to a negative number in params, set it here to the postsynaptic layer's nf.
If nfp is positive in params, it is a fatal error for nfp and post->nf to have different values. It is also a fatal error if there is no ConnectionData component, or more than one, in the CommunicateInitInfo message.
Reimplemented from PV::PatchSize.
Definition at line 55 of file DependentPatchSize.cpp.
|
inlineinherited |
Get-method for mDataStructuresAllocatedFlag, which is false on initialization and then becomes true once setDataStructuresAllocatedFlag() is called.
Definition at line 102 of file BaseObject.hpp.
|
inlineinherited |
Get-method for mInitialValuesSetFlag, which is false on initialization and then becomes true once setInitialValuesSetFlag() is called.
Definition at line 108 of file BaseObject.hpp.
|
inlineinherited |
Get-method for mInitInfoCommunicatedFlag, which is false on initialization and then becomes true once setInitInfoCommunicatedFlag() is called.
Definition at line 95 of file BaseObject.hpp.
|
inherited |
Method for reading or writing the params from group in the parent HyPerCol's parameters. The group from params is selected using the name of the connection.
If ioFlag is set to write, the printHeader and printFooter flags control whether a header and footer for the parameter group is produces. These flags are set to true for layers, connections, and probes; and set to false for weight initializers and normalizers. If ioFlag is set to read, the printHeader and printFooter flags are ignored.
Note that ioParams is not virtual. To add parameters in a derived class, override ioParamFillGroup.
Definition at line 74 of file BaseObject.cpp.
|
overrideprotectedvirtual |
The virtual method for reading parameters from the parent HyPerCol's parameters, and writing to the output params file.
Derived classes with additional parameters typically override ioParamsFillGroup to call the base class's ioParamsFillGroup method and then call ioParam_[parametername] for each of their parameters. The ioParam_[parametername] methods should call the parent HyPerCol's ioParamValue() and related methods, to ensure that all parameters that get read also get written to the outputParams-generated file.
Reimplemented from PV::BaseObject.
Definition at line 29 of file DependentPatchSize.cpp.
|
inlineinherited |
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 116 of file BaseObject.hpp.
|
inherited |
Look up the keyword of the params group with the same name as the object.
Definition at line 42 of file BaseObject.cpp.
|
inlineinherited |
A method that reads the parameters for the group whose name matches the name of the object. It, along with writeParams(), is a wrapper around ioParams, so that readParams and writeParams automatically run through the same parameters in the same order.
Definition at line 62 of file BaseObject.hpp.
|
inlineprotectedinherited |
This method sets mDataStructuresAllocatedFlag to true.
Definition at line 175 of file BaseObject.hpp.
|
inlineprotectedinherited |
This method sets the flag returned by getInitialValuesSetFlag to true.
Definition at line 180 of file BaseObject.hpp.
|
inlineprotectedinherited |
This method sets mInitInfoCommunicatedFlag to true.
Definition at line 170 of file BaseObject.hpp.
|
inlineinherited |
A method that writes the parameters for the group whose name matches the name of the object. It, along with readParams(), is a wrapper around ioParams, so that readParams and writeParams automatically run through the same parameters in the same order.
Definition at line 69 of file BaseObject.hpp.