PetaVision  Alpha
PV::BatchIndexer Class Reference
Inheritance diagram for PV::BatchIndexer:
PV::CheckpointerDataInterface PV::Observer

Public Types

enum  BatchMethod { BYFILE, BYLIST, BYSPECIFIED, RANDOM }
 

Public Member Functions

 BatchIndexer (std::string const &objName, int globalBatchCount, int globalBatchIndex, int batchWidth, int fileCount, enum BatchMethod batchMethod, bool initializeFromCheckpointFlag)
 
std::string const & getDescription () const
 
char const * getDescription_c () const
 
int getIndex (int localBatchIndex)
 
std::vector< int > getIndices ()
 
MPIBlock const * getMPIBlock ()
 
bool getWrapToStartIndex ()
 
void initializeBatch (int localBatchIndex)
 
int nextIndex (int localBatchIndex)
 
virtual Response::Status registerData (Checkpointer *checkpointer) override
 
virtual Response::Status respond (std::shared_ptr< BaseMessage const > message) override
 
void setIndices (const std::vector< int > &indices)
 
void setRandomSeed (unsigned int seed)
 
void setWrapToStartIndex (bool value)
 
void shuffleLookupTable ()
 
void specifyBatching (int localBatchIndex, int startIndex, int skipAmount)
 

Protected Member Functions

void checkIndices ()
 
virtual Response::Status prepareCheckpointWrite ()
 
virtual Response::Status processCheckpointRead () override
 
virtual Response::Status readStateFromCheckpoint (Checkpointer *checkpointer) override
 
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)
 

Protected Attributes

std::string description
 

Private Attributes

BatchMethod mBatchMethod
 
int mBatchOffset = 0
 
int mBatchWidth = 0
 
int mFileCount = 0
 
int mGlobalBatchCount = 0
 
std::vector< int > mIndexLookupTable
 
std::vector< int > mIndices
 
bool mInitializeFromCheckpointFlag = false
 
std::string mObjName
 
unsigned int mRandomSeed = 123456789
 
std::vector< int > mSkipAmounts
 
std::vector< int > mStartIndices
 
bool mWrapToStartIndex = true
 

Detailed Description

Definition at line 9 of file BatchIndexer.hpp.

Member Function Documentation

void PV::BatchIndexer::checkIndices ( )
protected

Exits with error if any of index is negative or >= fileCount. Called when reading or initializing from checkpoint.

Definition at line 148 of file BatchIndexer.cpp.


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