9 #include "include/pv_common.h" 11 #include "columns/HyPerCol.hpp" 13 #include "layers/ANNErrorLayer.hpp" 14 #include "layers/ANNLayer.hpp" 15 #include "layers/ANNSquaredLayer.hpp" 16 #include "layers/BackgroundLayer.hpp" 17 #include "layers/BinningLayer.hpp" 18 #include "layers/CloneVLayer.hpp" 19 #include "layers/ConstantLayer.hpp" 20 #include "layers/DropoutLayer.hpp" 21 #include "layers/FilenameParsingGroundTruthLayer.hpp" 22 #include "layers/GapLayer.hpp" 23 #include "layers/HyPerLCALayer.hpp" 24 #include "layers/HyPerLayer.hpp" 25 #include "layers/ISTALayer.hpp" 26 #include "layers/ImageLayer.hpp" 27 #include "layers/InputRegionLayer.hpp" 28 #include "layers/LIF.hpp" 29 #include "layers/LIFGap.hpp" 30 #include "layers/LeakyIntegrator.hpp" 31 #include "layers/MaskLayer.hpp" 32 #include "layers/MomentumLCALayer.hpp" 33 #include "layers/PoolingIndexLayer.hpp" 34 #include "layers/PtwiseProductLayer.hpp" 35 #include "layers/PtwiseQuotientLayer.hpp" 36 #include "layers/PvpLayer.hpp" 37 #include "layers/RescaleLayer.hpp" 38 #include "layers/Retina.hpp" 39 #include "layers/SigmoidLayer.hpp" 41 #include "deprecated/ANNWhitenedLayer.hpp" 42 #include "deprecated/ImageFromMemoryBuffer.hpp" 43 #include "deprecated/KmeansLayer.hpp" 44 #include "deprecated/LCALIFLayer.hpp" 45 #include "deprecated/LabelErrorLayer.hpp" 46 #include "deprecated/RunningAverageLayer.hpp" 47 #include "deprecated/ShuffleLayer.hpp" 48 #include "deprecated/WTALayer.hpp" 50 #include "connections/CloneConn.hpp" 51 #include "connections/CopyConn.hpp" 52 #include "connections/FeedbackConn.hpp" 53 #include "connections/GapConn.hpp" 54 #include "connections/HyPerConn.hpp" 55 #include "connections/IdentConn.hpp" 56 #include "connections/MomentumConn.hpp" 57 #include "connections/PlasticCloneConn.hpp" 58 #include "connections/PoolingConn.hpp" 59 #include "connections/RescaleConn.hpp" 60 #include "connections/TransposeConn.hpp" 61 #include "connections/TransposePoolingConn.hpp" 62 #include "connections/WTAConn.hpp" 64 #include "probes/AdaptiveTimeScaleProbe.hpp" 65 #include "probes/ColumnEnergyProbe.hpp" 66 #include "probes/FirmThresholdCostFnLCAProbe.hpp" 67 #include "probes/FirmThresholdCostFnProbe.hpp" 68 #include "probes/KernelProbe.hpp" 69 #include "probes/KneeTimeScaleProbe.hpp" 70 #include "probes/L0NormLCAProbe.hpp" 71 #include "probes/L0NormProbe.hpp" 72 #include "probes/L1NormLCAProbe.hpp" 73 #include "probes/L1NormProbe.hpp" 74 #include "probes/L2ConnProbe.hpp" 75 #include "probes/L2NormProbe.hpp" 76 #include "probes/LogTimeScaleProbe.hpp" 77 #include "probes/PointLIFProbe.hpp" 78 #include "probes/PointProbe.hpp" 79 #include "probes/QuotientColProbe.hpp" 80 #include "probes/RequireAllZeroActivityProbe.hpp" 81 #include "probes/StatsProbe.hpp" 83 #include "initv/ConstantV.hpp" 84 #include "initv/GaussianRandomV.hpp" 85 #include "initv/InitVFromFile.hpp" 86 #include "initv/UniformRandomV.hpp" 87 #include "initv/ZeroV.hpp" 89 #include "delivery/IdentDelivery.hpp" 90 #include "delivery/PostsynapticPerspectiveConvolveDelivery.hpp" 91 #include "delivery/PostsynapticPerspectiveStochasticDelivery.hpp" 92 #include "delivery/PresynapticPerspectiveConvolveDelivery.hpp" 93 #include "delivery/PresynapticPerspectiveStochasticDelivery.hpp" 94 #include "delivery/RescaleDelivery.hpp" 95 #include "delivery/WTADelivery.hpp" 98 #include "delivery/PostsynapticPerspectiveGPUDelivery.hpp" 99 #include "delivery/PresynapticPerspectiveGPUDelivery.hpp" 100 #endif // PV_USE_CUDA 102 #include "weightinit/InitCocircWeights.hpp" 103 #include "weightinit/InitGauss2DWeights.hpp" 104 #include "weightinit/InitGaussianRandomWeights.hpp" 105 #include "weightinit/InitIdentWeights.hpp" 106 #include "weightinit/InitOneToOneWeights.hpp" 107 #include "weightinit/InitOneToOneWeightsWithDelays.hpp" 108 #include "weightinit/InitSmartWeights.hpp" 109 #include "weightinit/InitSpreadOverArborsWeights.hpp" 110 #include "weightinit/InitUniformRandomWeights.hpp" 111 #include "weightinit/InitUniformWeights.hpp" 112 #include "weightinit/InitWeights.hpp" 114 #include "weightupdaters/HebbianUpdater.hpp" 116 #include "normalizers/NormalizeContrastZeroMean.hpp" 117 #include "normalizers/NormalizeGroup.hpp" 118 #include "normalizers/NormalizeL2.hpp" 119 #include "normalizers/NormalizeMax.hpp" 120 #include "normalizers/NormalizeNone.hpp" 121 #include "normalizers/NormalizeSum.hpp" 128 keywordHandlerList = std::vector<KeywordHandler *>();
133 registerKeyword(
"ANNWhitenedLayer", Factory::create<ANNWhitenedLayer>);
140 "FilenameParsingGroundTruthLayer", Factory::create<FilenameParsingGroundTruthLayer>);
147 registerKeyword(
"InputRegionLayer", Factory::create<InputRegionLayer>);
149 registerKeyword(
"ImageFromMemoryBuffer", Factory::create<ImageFromMemoryBuffer>);
157 registerKeyword(
"MomentumLCALayer", Factory::create<MomentumLCALayer>);
158 registerKeyword(
"PoolingIndexLayer", Factory::create<PoolingIndexLayer>);
159 registerKeyword(
"PtwiseProductLayer", Factory::create<PtwiseProductLayer>);
160 registerKeyword(
"PtwiseQuotientLayer", Factory::create<PtwiseQuotientLayer>);
162 registerKeyword(
"RunningAverageLayer", Factory::create<RunningAverageLayer>);
176 registerKeyword(
"PlasticCloneConn", Factory::create<PlasticCloneConn>);
180 registerKeyword(
"TransposePoolingConn", Factory::create<TransposePoolingConn>);
183 registerKeyword(
"AdaptiveTimeScaleProbe", Factory::create<AdaptiveTimeScaleProbe>);
184 registerKeyword(
"KneeTimeScaleProbe", Factory::create<KneeTimeScaleProbe>);
185 registerKeyword(
"LogTimeScaleProbe", Factory::create<LogTimeScaleProbe>);
186 registerKeyword(
"ColumnEnergyProbe", Factory::create<ColumnEnergyProbe>);
187 registerKeyword(
"FirmThresholdCostFnLCAProbe", Factory::create<FirmThresholdCostFnLCAProbe>);
188 registerKeyword(
"FirmThresholdCostFnProbe", Factory::create<FirmThresholdCostFnProbe>);
198 registerKeyword(
"QuotientColProbe", Factory::create<QuotientColProbe>);
199 registerKeyword(
"RequireAllZeroActivityProbe", Factory::create<RequireAllZeroActivityProbe>);
210 "PostsynapticPerspectiveConvolveDelivery",
211 Factory::create<PostsynapticPerspectiveConvolveDelivery>);
213 "PostsynapticPerspectiveStochasticDelivery",
214 Factory::create<PostsynapticPerspectiveStochasticDelivery>);
216 "PresynapticPerspectiveConvolveDelivery",
217 Factory::create<PresynapticPerspectiveConvolveDelivery>);
219 "PresynapticPerspectiveStochasticDelivery",
220 Factory::create<PresynapticPerspectiveStochasticDelivery>);
225 "PostsynapticPerspectiveGPUDelivery", Factory::create<PostsynapticPerspectiveGPUDelivery>);
227 "PresynapticPerspectiveGPUDelivery", Factory::create<PresynapticPerspectiveGPUDelivery>);
228 #endif // PV_USE_CUDA 234 registerKeyword(
"UniformRandomWeight", Factory::create<InitUniformRandomWeights>);
235 registerKeyword(
"GaussianRandomWeight", Factory::create<InitGaussianRandomWeights>);
237 registerKeyword(
"OneToOneWeights", Factory::create<InitOneToOneWeights>);
238 registerKeyword(
"OneToOneWeightsWithDelays", Factory::create<InitOneToOneWeightsWithDelays>);
239 registerKeyword(
"SpreadOverArborsWeight", Factory::create<InitSpreadOverArborsWeights>);
244 registerKeyword(
"normalizeContrastZeroMean", Factory::create<NormalizeContrastZeroMean>);
255 for (
auto &kh : orig) {
263 if (keywordHandler !=
nullptr) {
267 keywordHandlerList.push_back(newKeyword);
272 if (keyword ==
nullptr) {
276 if (keywordHandler ==
nullptr) {
277 auto errorString = std::string(keyword).append(
" \"").append(name).append(
"\": ");
278 errorString.append(
"keyword \"").append(keyword).append(
"\" is unrecognized.");
279 throw std::invalid_argument(errorString);
281 return keywordHandler ? keywordHandler->
create(name, hc) :
nullptr;
285 pvAssert(keyword !=
nullptr);
286 for (
auto &typeCreator : keywordHandlerList) {
287 if (!strcmp(typeCreator->getKeyword(), keyword)) {
295 for (
auto &kh : keywordHandlerList) {
298 keywordHandlerList.clear();
int registerKeyword(char const *keyword, ObjectCreateFn creator)
int copyKeywordHandlerList(std::vector< KeywordHandler * > const &orig)
BaseObject * create(char const *name, HyPerCol *hc) const
KeywordHandler const * getKeywordHandler(char const *keyword) const
int registerCoreKeywords()
BaseObject * createByKeyword(char const *keyword, char const *name, HyPerCol *hc) const
int clearKeywordHandlerList()