PetaVision  Alpha
CloneWeightsPair.hpp
1 /*
2  * CloneWeightsPair.hpp
3  *
4  * Created on: Dec 3, 2017
5  * Author: Pete Schultz
6  */
7 
8 #ifndef CLONEWEIGHTSPAIR_HPP_
9 #define CLONEWEIGHTSPAIR_HPP_
10 
11 #include "components/WeightsPair.hpp"
12 #include "connections/HyPerConn.hpp"
13 
14 namespace PV {
15 
16 class CloneWeightsPair : public WeightsPair {
17  protected:
27  virtual void ioParam_writeStep(enum ParamsIOFlag ioFlag) override;
28 
33  virtual void ioParam_writeCompressedCheckpoints(enum ParamsIOFlag ioFlag) override;
34  // end of CloneWeightsPair parameters
36 
37  public:
38  CloneWeightsPair(char const *name, HyPerCol *hc);
39 
40  virtual ~CloneWeightsPair();
41 
47  void synchronizeMarginsPre();
48 
55 
56  protected:
57  CloneWeightsPair() {}
58 
59  int initialize(char const *name, HyPerCol *hc);
60 
61  virtual void setObjectType() override;
62 
63  int ioParamsFillGroup(enum ParamsIOFlag ioFlag) override;
64 
65  virtual Response::Status
66  communicateInitInfo(std::shared_ptr<CommunicateInitInfoMessage const> message) override;
67 
68  virtual void createPreWeights(std::string const &weightsName) override;
69  virtual void createPostWeights(std::string const &weightsName) override;
70 
71  virtual Response::Status allocateDataStructures() override;
72 
73  virtual Response::Status registerData(Checkpointer *checkpointer) override;
74 
75  virtual void finalizeUpdate(double timestamp, double deltaTime) override;
76 
77  virtual void outputState(double timestamp) override;
78 
79  protected:
80  HyPerConn *mOriginalConn = nullptr;
81  WeightsPair *mOriginalWeightsPair = nullptr;
82 };
83 
84 } // namespace PV
85 
86 #endif // CLONEWEIGHTSPAIR_HPP_
int ioParamsFillGroup(enum ParamsIOFlag ioFlag) override
virtual void ioParam_writeCompressedCheckpoints(enum ParamsIOFlag ioFlag) override
writeStep: CloneWeightsPair does not checkpoint, so writeCompressedCheckpoints is always set to false...
virtual void createPostWeights(std::string const &weightsName) override
virtual void createPreWeights(std::string const &weightsName) override
virtual void ioParam_writeStep(enum ParamsIOFlag ioFlag) override
writeStep: CloneWeightsPair never writes output, always sets writeStep to -1.