diff --git a/HotgymExample/hotgym.py b/HotgymExample/hotgym.py index c935712..000797b 100644 --- a/HotgymExample/hotgym.py +++ b/HotgymExample/hotgym.py @@ -314,7 +314,7 @@ def main(parameters=default_parameters, argv=None, verbose=True): return -accuracy[5] -#with this method, the structure for visualisation is defined +#with this method, the structure for visualization is defined def BuildPandaSystem(sp,tm,consumptionBits_size,dateBits_size): #we have two inputs connected to proximal synapses of Layer1 diff --git a/PandaVis/bakeReader/bakeReader.py b/PandaVis/bakeReader/bakeReader.py index 784a721..ef685b3 100644 --- a/PandaVis/bakeReader/bakeReader.py +++ b/PandaVis/bakeReader/bakeReader.py @@ -66,6 +66,8 @@ def BuildStructure(self): # figure out how many iterations there are self.cntIterations = self.LoadMaxIteration("inputs_"+next(iter(self.inputs)))# get first input + if self.cntIterations is None: + raise RuntimeError("Database contains no data!") Log("Database contains data for "+str(self.cntIterations)+" iterations.") def LoadDataStreams(self): diff --git a/dashVis/layouts/NAB htmcore detector.txt b/dashVis/layouts/NAB htmcore detector.txt new file mode 100644 index 0000000..6805b6a --- /dev/null +++ b/dashVis/layouts/NAB htmcore detector.txt @@ -0,0 +1,43 @@ +{"plotsPerRow" : 3, +"streams": [{"name" : "rawAnomaly", + "type" : "line", + "yaxis": "anomaly"}, + {"name" : "value", + "type" : "line", + "yaxis": "kWh"}, + {"name" : "numberOfWinnerCells", + "type" : "line", + "yaxis": "cells"}, + + {"name" : "numberOfPredictiveCells", + "type" : "line", + "yaxis": "cells"}, + {"name" : "valueInput_sparsity", + "type" : "line", + "yaxis": "%"}, + {"name" : "dateInput_sparsity", + "type" : "line", + "yaxis": "%"}, + + {"name" : "Layer1_SP_overlap_metric", + "type" : "line", + "yaxis": "avg cells"}, + {"name" : "Layer1_TM_overlap_metric", + "type" : "line", + "yaxis": "avg cells"}, + {"name" : "Layer1_SP_activation_frequency", + "type" : "line", + "yaxis": "Hz"}, + {"name" : "Layer1_TM_activation_frequency", + "type" : "line", + "yaxis": "Hz"}, + + {"name" : "Layer1_SP_entropy", + "type" : "line", + "yaxis": "entropy"}, + {"name" : "Layer1_TM_entropy", + "type" : "line", + "yaxis": "entropy"} + ] +} + diff --git a/dashVis/layouts/myLayout1.txt b/dashVis/layouts/hotgym.txt similarity index 100% rename from dashVis/layouts/myLayout1.txt rename to dashVis/layouts/hotgym.txt diff --git a/dashVis/layouts/myLayout2.txt b/dashVis/layouts/myLayout2.txt deleted file mode 100644 index 06315f0..0000000 --- a/dashVis/layouts/myLayout2.txt +++ /dev/null @@ -1,13 +0,0 @@ -{"plotsPerRow" : 3, -"streams": [{"name" : "rawAnomaly", - "type" : "line", - "yaxis": "anomaly"}, - {"name" : "powerConsumption", - "type" : "line", - "yaxis": "kWh"}, - {"name" : "numberOfWinnerCells", - "type" : "line", - "yaxis": "cells"} - ] - -} diff --git a/pandaBaker/pandaBaker.py b/pandaBaker/pandaBaker.py index 0b722ce..e81a9de 100644 --- a/pandaBaker/pandaBaker.py +++ b/pandaBaker/pandaBaker.py @@ -14,7 +14,7 @@ CPU_CORES = 4 class PandaBaker(object): - def __init__(self, databaseFilePath): + def __init__(self, databaseFilePath, bakeProximalSynapses = True, bakeDistalSynapses = True): self.databaseFilePath = databaseFilePath self.db = None @@ -23,8 +23,8 @@ def __init__(self, databaseFilePath): self.dataStreams = {} # can contain cDataStream instances #flags what to bake - self.bakeProximalSynapses = True - self.bakeDistalSynapses = True + self.bakeProximalSynapses = bakeProximalSynapses + self.bakeDistalSynapses = bakeDistalSynapses # for raw anomaly calculation self.previousPredictiveCells = {} # dict storing predictive cells for previous timestamp for each layer @@ -136,6 +136,6 @@ def Log(s): print(str(s)) from datetime import datetime dateStr=datetime.now().strftime('%Y-%m-%d %H:%M:%S') - with open("logs/pandaBaker.log","a") as file: + with open(os.path.join(os.getcwd(), "logs","pandaBaker.log"),"a") as file: file.write(dateStr+" >> "+str(s)+"\n")