Skip to content

Commit

Permalink
SP serialization fix: added missing fields
Browse files Browse the repository at this point in the history
version_
boostedOverlaps_
minActiveDutyCycles_

thanks @N3rv0uS, @pmenn36 and everyone who investigated the issue.
For issue #874
breznak committed Sep 2, 2020
1 parent e376e49 commit bf9c40e
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions src/htm/algorithms/SpatialPooler.hpp
Original file line number Diff line number Diff line change
@@ -300,13 +300,19 @@ class SpatialPooler : public Serializable
CEREAL_NVP(synPermBelowStimulusInc_),
CEREAL_NVP(synPermConnected_),
CEREAL_NVP(minPctOverlapDutyCycles_),
CEREAL_NVP(wrapAround_));
CEREAL_NVP(wrapAround_),
CEREAL_NVP(version_)
);
ar(CEREAL_NVP(boostFactors_));
ar(CEREAL_NVP(overlapDutyCycles_));
ar(CEREAL_NVP(activeDutyCycles_));
ar(CEREAL_NVP(minOverlapDutyCycles_));
ar(CEREAL_NVP(connections_));
ar(CEREAL_NVP(rng_));
ar(CEREAL_NVP(minActiveDutyCycles_));
ar(CEREAL_NVP(boostedOverlaps_)); //boostedOverlaps_ are re-created in each compute()
//...but if deserialized SP does some other action, it may get out of order.

}
// FOR Cereal Deserialization
template<class Archive>
@@ -334,16 +340,17 @@ class SpatialPooler : public Serializable
CEREAL_NVP(synPermBelowStimulusInc_),
CEREAL_NVP(synPermConnected_),
CEREAL_NVP(minPctOverlapDutyCycles_),
CEREAL_NVP(wrapAround_));
CEREAL_NVP(wrapAround_),
CEREAL_NVP(version_)
);
ar(CEREAL_NVP(boostFactors_));
ar(CEREAL_NVP(overlapDutyCycles_));
ar(CEREAL_NVP(activeDutyCycles_));
ar(CEREAL_NVP(minOverlapDutyCycles_));
ar(CEREAL_NVP(connections_));
ar(CEREAL_NVP(rng_));

// initialize ephemeral members
boostedOverlaps_.resize(numColumns_);
ar(CEREAL_NVP(minActiveDutyCycles_));
ar(CEREAL_NVP(boostedOverlaps_));
}

/**

0 comments on commit bf9c40e

Please sign in to comment.