PetaVision
Alpha
|
#include <WTAConn.hpp>
Public Member Functions | |
WTAConn (const char *name, HyPerCol *hc) | |
virtual void | addObserver (Observer *observer) override |
int | deliver () |
void | deliverUnitInput (float *recvBuffer) |
ChannelType | getChannelCode () const |
template<typename S > | |
S * | getComponentByType () |
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 |
HyPerLayer * | getPost () const |
char const * | getPostLayerName () const |
HyPerLayer * | getPre () const |
char const * | getPreLayerName () const |
bool | getReceiveGpu () 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 ConnectionData * | createConnectionData () |
virtual BaseDelivery * | createDeliveryObject () override |
virtual SingleArbor * | createSingleArbor () |
virtual void | defineComponents () override |
virtual void | deleteComponents () |
int | initialize (const char *name, HyPerCol *hc) |
virtual Response::Status | initializeState () |
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 | respondConnectionOutput (std::shared_ptr< ConnectionOutputMessage 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 |
ObserverTable | mComponentTable |
PVCuda::CudaDevice * | mCudaDevice = nullptr |
bool | mDataStructuresAllocatedFlag = false |
bool | mInitialValuesSetFlag = false |
bool | mInitInfoCommunicatedFlag = false |
std::string | mObjectType |
bool | mUsingGPUFlag = false |
char * | name = nullptr |
HyPerCol * | parent = nullptr |
A connection class to perform winner-take-all computation. If the pre-layer is nx-by-ny-by-nf, the post-layer must be nx-by-ny-by-1. A single arbor is used, and the delay parameter is meaningful. A WTADeliver component handles the update of the post-synaptic GSyn.
Definition at line 24 of file WTAConn.hpp.
|
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.
|
inlineinherited |
The function that calls the DeliveryObject's deliver method
Definition at line 39 of file BaseConnection.hpp.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.