PetaVision  Alpha
PV::FeedbackConn Class Reference
Inheritance diagram for PV::FeedbackConn:
PV::TransposeConn PV::HyPerConn PV::BaseConnection PV::BaseObject PV::Subject PV::CheckpointerDataInterface PV::Observer

Public Member Functions

 FeedbackConn (char const *name, HyPerCol *hc)
 
virtual void addObserver (Observer *observer) override
 
int calcDataIndexFromPatchIndex (int patchIndex)
 
int deliver ()
 
void deliverUnitInput (float *recvBuffer)
 
ChannelType getChannelCode () const
 
template<typename S >
S * getComponentByType ()
 
bool getDataStructuresAllocatedFlag () const
 
int getDelay (int arbor) const
 
float const * getDeltaWeightsDataHead (int arbor, int dataIndex) const
 
float const * getDeltaWeightsDataStart (int arbor) const
 
std::string const & getDescription () const
 
char const * getDescription_c () const
 
bool getInitialValuesSetFlag () const
 
bool getInitInfoCommunicatedFlag () const
 
double getLastUpdateTime () const
 
MPIBlock const * getMPIBlock ()
 
char const * getName () const
 
int getNumAxonalArbors () const
 
int getNumDataPatches () const
 
int getNumGeometryPatches () const
 
std::string const & getObjectType () const
 
Patch const * getPatch (int kPre)
 
int getPatchSizeF () const
 
int getPatchSizeX () const
 
int getPatchSizeY () const
 
int getPatchStrideF () const
 
int getPatchStrideX () const
 
int getPatchStrideY () const
 
HyPerLayergetPost () const
 
char const * getPostLayerName () const
 
HyPerLayergetPre () const
 
char const * getPreLayerName () const
 
bool getReceiveGpu () const
 
int getSharedWeights () const
 
int getStrength () const
 
float * getWeightsData (int arbor, int patchIndex)
 
float * getWeightsDataHead (int arbor, int dataIndex) const
 
float * getWeightsDataStart (int arbor) const
 
void ioParams (enum ParamsIOFlag ioFlag, bool printHeader, bool printFooter)
 
bool isAllInputReady ()
 
bool isUsingGPU () const
 
char const * lookupKeyword () const
 
void readParams ()
 
virtual Response::Status respond (std::shared_ptr< BaseMessage const > message) override
 
void writeParams ()
 

Protected Member Functions

virtual Response::Status allocateDataStructures () override
 
virtual Response::Status cleanup ()
 
virtual Response::Status communicateInitInfo (std::shared_ptr< CommunicateInitInfoMessage const > message) override
 
virtual Response::Status copyInitialStateToGPU ()
 
virtual ArborListcreateArborList () override
 
virtual ConnectionDatacreateConnectionData () override
 
virtual BaseDeliverycreateDeliveryObject () override
 
virtual OriginalConnNameParamcreateOriginalConnNameParam ()
 
virtual PatchSizecreatePatchSize () override
 
virtual SharedWeightscreateSharedWeights () override
 
virtual InitWeightscreateWeightInitializer () override
 
virtual NormalizeBasecreateWeightNormalizer () override
 
virtual WeightsPairInterfacecreateWeightsPair () override
 
virtual BaseWeightUpdatercreateWeightUpdater () override
 
virtual void defineComponents () override
 
virtual void deleteComponents ()
 
int initialize (char const *name, HyPerCol *hc)
 
virtual Response::Status initializeState () override
 
int ioParamsFillGroup (enum ParamsIOFlag ioFlag) override
 
Response::Status notify (ObserverTable const &table, std::vector< std::shared_ptr< BaseMessage const >> messages, bool printFlag)
 
Response::Status notify (ObserverTable const &table, std::shared_ptr< BaseMessage const > message, bool printFlag)
 
void notifyLoop (ObserverTable const &table, std::vector< std::shared_ptr< BaseMessage const >> messages, bool printFlag, std::string const &description)
 
void notifyLoop (ObserverTable const &table, std::shared_ptr< BaseMessage const > message, bool printFlag, std::string const &description)
 
virtual Response::Status prepareCheckpointWrite ()
 
virtual Response::Status processCheckpointRead ()
 
virtual Response::Status readStateFromCheckpoint (Checkpointer *checkpointer) override
 
virtual Response::Status registerData (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 respondConnectionFinalizeUpdate (std::shared_ptr< ConnectionFinalizeUpdateMessage const > message)
 
Response::Status respondConnectionNormalize (std::shared_ptr< ConnectionNormalizeMessage const > message)
 
Response::Status respondConnectionOutput (std::shared_ptr< ConnectionOutputMessage const > message)
 
Response::Status respondConnectionUpdate (std::shared_ptr< ConnectionUpdateMessage const > message)
 
Response::Status respondConnectionWriteParams (std::shared_ptr< ConnectionWriteParamsMessage 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) override
 
void setDataStructuresAllocatedFlag ()
 
void setDescription ()
 
void setInitialValuesSetFlag ()
 
void setInitInfoCommunicatedFlag ()
 
int setName (char const *name)
 
virtual void setObjectType ()
 
int setParent (HyPerCol *hc)
 

Protected Attributes

std::string description
 
ArborListmArborList = nullptr
 
ObserverTable mComponentTable
 
PVCuda::CudaDevice * mCudaDevice = nullptr
 
bool mDataStructuresAllocatedFlag = false
 
bool mInitialValuesSetFlag = false
 
bool mInitInfoCommunicatedFlag = false
 
std::string mObjectType
 
OriginalConnNameParammOriginalConnNameParam = nullptr
 
PatchSizemPatchSize = nullptr
 
SharedWeightsmSharedWeights = nullptr
 
TimermUpdateTimer = nullptr
 
bool mUsingGPUFlag = false
 
InitWeightsmWeightInitializer = nullptr
 
NormalizeBasemWeightNormalizer = nullptr
 
WeightsPairInterfacemWeightsPair = nullptr
 
BaseWeightUpdatermWeightUpdater = nullptr
 
char * name = nullptr
 
HyPerColparent = nullptr
 

Detailed Description

Definition at line 15 of file FeedbackConn.hpp.

Member Function Documentation

void PV::BaseConnection::addObserver ( Observer observer)
overridevirtualinherited

The virtual method for adding an Observer-derived object. Derived classes must override this method to add the object to their hierarchy.

Reimplemented from PV::Subject.

Definition at line 34 of file BaseConnection.cpp.

int PV::BaseConnection::deliver ( )
inlineinherited

The function that calls the DeliveryObject's deliver method

Definition at line 39 of file BaseConnection.hpp.

bool PV::BaseObject::getDataStructuresAllocatedFlag ( ) const
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.

bool PV::BaseObject::getInitialValuesSetFlag ( ) const
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.

bool PV::BaseObject::getInitInfoCommunicatedFlag ( ) const
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.

void PV::BaseObject::ioParams ( enum ParamsIOFlag  ioFlag,
bool  printHeader,
bool  printFooter 
)
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.

int PV::BaseConnection::ioParamsFillGroup ( enum ParamsIOFlag  ioFlag)
overrideprotectedvirtualinherited

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 53 of file BaseConnection.cpp.

bool PV::BaseObject::isUsingGPU ( ) const
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.

char const * PV::BaseObject::lookupKeyword ( ) const
inherited

Look up the keyword of the params group with the same name as the object.

Definition at line 42 of file BaseObject.cpp.

Response::Status PV::Subject::notify ( ObserverTable const &  table,
std::vector< std::shared_ptr< BaseMessage const >>  messages,
bool  printFlag 
)
protectedinherited

This method calls the respond() method of each object in the given table, using the given vector of messages. If the table consists of objects A, B, and C; and the messages vector consists of messages X and Y, the order is A->X, A->Y, B->X, B->Y, C->X, C->Y.

The objects' respond() method returns one of the Response::Status types: SUCCESS, NO_ACTION, PARTIAL, or PV_POSTPONE.

SUCCESS: the object completed the task requested by the messages. NO_ACTION: the object has nothing to do in response to the message, or had already done it. PARTIAL: the object has not yet completed but is making progress. It is expected that there are a small number of descrete tasks, so that an object will not return PARTIAL a large number of times in response to the same message. POSTPONE: the object needs to act but cannot do so until an event outside its control occurs.

If all objects return NO_ACTION, then notify() returns NO_ACTION. If all objects return either SUCCESS or NO_ACTION and there is at least one SUCCESS, then notify() returns SUCCESS. If all objects return either POSTPONE or NO_ACTION and there is at least one POSTPONE, then notify() returns POSTPONE. Otherwise, notify() returns PARTIAL.

Generally each message in the messages vector is sent to each object in the table. However, if an object returns POSTPONE in response to a message, the loop skips to the next object, and does not sent any remaining messages to the postponing object.

The rationale behind these rules is so that if the objects in the table are themselves derived from the Subject class, the messages can be passed down the tree and the return values passed up it, and the return value at the top can be interpreted as being over all the components at the bottom, without the topmost object needing to know details of the composition of the objects below it.

If printFlag is true, the method prints information regarding postponement to standard output.

Definition at line 15 of file Subject.cpp.

Response::Status PV::Subject::notify ( ObserverTable const &  table,
std::shared_ptr< BaseMessage const >  message,
bool  printFlag 
)
inlineprotectedinherited

A convenience overload of the basic notify method where there is only one message to send to the objects. This overloading handles enclosing the message in a vector of length one.

Definition at line 91 of file Subject.hpp.

void PV::Subject::notifyLoop ( ObserverTable const &  table,
std::vector< std::shared_ptr< BaseMessage const >>  messages,
bool  printFlag,
std::string const &  description 
)
protectedinherited

This method calls the notify() method in a loop until the result is not PARTIAL. If it is either POSTPONE, it exits with a fatal error. The description argument is used in the error message to report which message vector failed. If the result is PV_SUCCESS, notifyLoop() returns to the calling function.

notifyLoop should only be used if the objects that might cause a postponement are themselves in the table of objects; otherwise the routine will hang.

Definition at line 57 of file Subject.cpp.

void PV::Subject::notifyLoop ( ObserverTable const &  table,
std::shared_ptr< BaseMessage const >  message,
bool  printFlag,
std::string const &  description 
)
inlineprotectedinherited

A convenience overload of the basic notifyLoop method where there is only one message to send to the objects. This overloading handles enclosing the message in a vector of length one.

Definition at line 114 of file Subject.hpp.

void PV::BaseObject::readParams ( )
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.

void PV::BaseObject::setDataStructuresAllocatedFlag ( )
inlineprotectedinherited

This method sets mDataStructuresAllocatedFlag to true.

Definition at line 175 of file BaseObject.hpp.

void PV::BaseObject::setInitialValuesSetFlag ( )
inlineprotectedinherited

This method sets the flag returned by getInitialValuesSetFlag to true.

Definition at line 180 of file BaseObject.hpp.

void PV::BaseObject::setInitInfoCommunicatedFlag ( )
inlineprotectedinherited

This method sets mInitInfoCommunicatedFlag to true.

Definition at line 170 of file BaseObject.hpp.

void PV::BaseObject::writeParams ( )
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.


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