Skip to content

Commit

Permalink
Merge branch 'master' into msvc2019
Browse files Browse the repository at this point in the history
  • Loading branch information
dkeeney committed Jul 15, 2019
2 parents fe452ed + ab1822a commit 1f37114
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 13 deletions.
3 changes: 0 additions & 3 deletions src/examples/hotgym/HelloSPTP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -158,9 +158,6 @@ Real64 BenchmarkHotgym::run(UInt EPOCHS, bool useSPlocal, bool useSPglobal, bool
cout << "Init:\t" << tInit.getElapsed() << endl;
cout << "Random:\t" << tRng.getElapsed() << endl;
cout << "Encode:\t" << tEnc.getElapsed() << endl;
cout << "Inh " << spGlobal.tInh.getElapsed() << endl;
cout << "Overlaps " << spGlobal.tOverlap.getElapsed() << endl;

if(useSPlocal) cout << "SP (l):\t" << tSPloc.getElapsed()*1.0f << endl;
if(useSPglobal) cout << "SP (g):\t" << tSPglob.getElapsed() << endl;
if(useTM) cout << "TM:\t" << tTM.getElapsed() << endl;
Expand Down
4 changes: 1 addition & 3 deletions src/examples/mnist/MNIST_SP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,9 +155,7 @@ void train(const bool skipSP=false) {
}

tTrain.stop();
cout << "MNIST train time: " << tTrain.getElapsed() << endl;
cout << "inh " << sp.tInh.getElapsed() << endl;
cout << "over " << sp.tOverlap.getElapsed() << endl;
cout << "MNIST train time: " << tTrain.getElapsed() << endl;

// Save the connections to file for postmortem analysis.
ofstream dump("mnist_sp_learned.connections", ofstream::binary | ofstream::trunc | ofstream::out);
Expand Down
5 changes: 0 additions & 5 deletions src/htm/algorithms/SpatialPooler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -463,22 +463,17 @@ void SpatialPooler::compute(const SDR &input, const bool learn, SDR &active) {
input.reshape( inputDimensions_ );
active.reshape( columnDimensions_ );
updateBookeepingVars_(learn);

tOverlap.start();
calculateOverlap_(input, overlaps_);
tOverlap.stop();

boostOverlaps_(overlaps_, boostedOverlaps_);

tInh.start();
auto &activeVector = active.getSparse();
inhibitColumns_(boostedOverlaps_, activeVector);
// Notify the active SDR that its internal data vector has changed. Always
// call SDR's setter methods even if when modifying the SDR's own data
// inplace.
sort( activeVector.begin(), activeVector.end() );
active.setSparse( activeVector );
tInh.stop();

if (learn) {
adaptSynapses_(input, active);
Expand Down
3 changes: 1 addition & 2 deletions src/htm/algorithms/SpatialPooler.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
#include <htm/types/Types.hpp>
#include <htm/types/Serializable.hpp>
#include <htm/types/Sdr.hpp>
#include <htm/os/Timer.hpp>


namespace htm {

Expand Down Expand Up @@ -61,7 +61,6 @@ using namespace std;
class SpatialPooler : public Serializable
{
public:
Timer tInh, tOverlap;

const Real MAX_LOCALAREADENSITY = 0.5f; //require atleast 2 areas

Expand Down

0 comments on commit 1f37114

Please sign in to comment.