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