Skip to content
Snippets Groups Projects
Commit a1d37cc6 authored by hammouda's avatar hammouda
Browse files

Synaptic activity module update

parent fca7d189
No related branches found
No related tags found
1 merge request!25VS2N 0.36
...@@ -190,18 +190,17 @@ class Global_Var(): ...@@ -190,18 +190,17 @@ class Global_Var():
heatmap = np.zeros((x, y)) heatmap = np.zeros((x, y))
heatmap[:] = -1 heatmap[:] = -1
data = data.to_numpy() data = data.to_numpy()
print(data)
if(depth == 0): # single depth if(depth == 0): # single depth
for d in data: for d in data:
heatmap[int(d[0])][int(d[1])] = d[3] heatmap[int(d[0])][int(d[1])] = d[3]
else: # multiple dimensions else: # multiple dimensions
for d in data: for d in data:
if(heatmap[int(d[0])][int(d[1])] == -1): if(d[2] == 0):
#if(heatmap[int(d[0])][int(d[1])] == -1):
heatmap[int(d[0])][int(d[1])] = d[3] heatmap[int(d[0])][int(d[1])] = d[3]
else: #else:
if(heatmap[int(d[0])][int(d[1])] < d[3]): # heatmap[int(d[0])][int(d[1])] = np.mean(heatmap[int(d[0])][int(d[1])]+d[3])
heatmap[int(d[0])][int(d[1])] = -d[3]
return heatmap return heatmap
......
...@@ -358,7 +358,7 @@ class callbacks(callbacksOp): ...@@ -358,7 +358,7 @@ class callbacks(callbacksOp):
heatMapY = data["y"].max() + 1 heatMapY = data["y"].max() + 1
depth = data["C"].max() depth = data["C"].max()
data = data[["x", "y", "C", "V"]] data = data[["x", "y", "C", "V", "To"]]
data = data.sort_values(["C"]) data = data.sort_values(["C"])
for i in g.LayersNeuronsInfo: for i in g.LayersNeuronsInfo:
...@@ -376,7 +376,7 @@ class callbacks(callbacksOp): ...@@ -376,7 +376,7 @@ class callbacks(callbacksOp):
if(index < neuronsNbr): if(index < neuronsNbr):
fig.add_trace( fig.add_trace(
go.Heatmap( go.Heatmap(
zmin=-1, zmin=0,
zmax=1, zmax=1,
z=g.createHeatMap( z=g.createHeatMap(
heatMapX, heatMapY, data[data.To == index],depth), heatMapX, heatMapY, data[data.To == index],depth),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment