Skip to content
Snippets Groups Projects
Commit cd303efe authored by Hammouda Elbez's avatar Hammouda Elbez :computer:
Browse files

Neuron module updated

parent 35a97b4d
No related branches found
No related tags found
1 merge request!26Custom 2d view
...@@ -23,7 +23,6 @@ class layout(layoutOp): ...@@ -23,7 +23,6 @@ class layout(layoutOp):
xAxisPotentialGraph = dict() xAxisPotentialGraph = dict()
yAxisSpikeNbrGraph = dict() yAxisSpikeNbrGraph = dict()
yAxisPotentialGraph = dict() yAxisPotentialGraph = dict()
SpikePerNeuron = None
def clearData(self, indexes): def clearData(self, indexes):
""" Clear the data when moved forward or backward for more than one step """ Clear the data when moved forward or backward for more than one step
...@@ -59,7 +58,6 @@ class layout(layoutOp): ...@@ -59,7 +58,6 @@ class layout(layoutOp):
self.clearData([]) self.clearData([])
if self.g.config.DEBUG: if self.g.config.DEBUG:
print("neuron-vis") print("neuron-vis")
self.SpikePerNeuron = self.getSpikePerNeuron(self.g)
layer = dbc.Card( layer = dbc.Card(
dbc.CardBody( dbc.CardBody(
[ [
...@@ -115,7 +113,7 @@ class layout(layoutOp): ...@@ -115,7 +113,7 @@ class layout(layoutOp):
'title': 'No Labels detected'}} 'title': 'No Labels detected'}}
else: else:
data = self.SpikePerNeuron data = self.getSpikePerNeuron(self.g)
total = 0 total = 0
...@@ -124,11 +122,9 @@ class layout(layoutOp): ...@@ -124,11 +122,9 @@ class layout(layoutOp):
xx = [N["i"]["N"] for N in data] xx = [N["i"]["N"] for N in data]
yy = [(count["count"]/total) for count in data] yy = [(count["count"]/total) for count in data]
zz = [int(c["Label"]) for i, c in product(data, g.finalLabels) if ( zz = [int(c["Label"]) for i, c in product(data, g.finalLabels) if (int(c["N"]) == int(i["i"]["N"]) and c["L"] == i["i"]["L"])]
int(c["N"]) == int(i["i"]["N"]) and c["L"] == i["i"]["L"])]
labels = list(dict.fromkeys(zz)) labels = list(dict.fromkeys(zz))
items = [[[item[0], item[1], item[2]] items = [[[item[0], item[1], item[2]]
for item in zip(xx, yy, zz) if item[2] == x] for x in labels] for item in zip(xx, yy, zz) if item[2] == x] for x in labels]
...@@ -181,12 +177,11 @@ class layout(layoutOp): ...@@ -181,12 +177,11 @@ class layout(layoutOp):
return {'data': [], return {'data': [],
'layout': {'margin': {'l': 0, 'r': 0, 't': 30, 'b': 0}}} 'layout': {'margin': {'l': 0, 'r': 0, 't': 30, 'b': 0}}}
else: else:
data = self.SpikePerNeuron data = self.getSpikePerNeuron(self.g)
data = [d for d, l in product(data, g.finalLabels) if ( data = [d for d, l in product(data, g.finalLabels)
int(l["N"]) == d['i']['N'] and int(l["Label"]) == filteredClass["z"])] if (l["N"] == d['i']['N'] and l["Label"] == filteredClass["z"])]
xx = [N["i"]["N"] for N in data] xx = [N["i"]["N"] for N in data]
yy = [count["count"] for count in data] yy = [count["count"] for count in data]
graph = {'data': [go.Bar( graph = {'data': [go.Bar(
x=[x for x in range(len(xx))], x=[x for x in range(len(xx))],
y=yy, y=yy,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment