diff --git a/src/Modules/General/callbacks.py b/src/Modules/General/callbacks.py index a7fc92c631dd9fbed9a75e1b211597994d0c01b5..0d55f3aa0dc85164bbdaf9c3411c7646a267b15b 100755 --- a/src/Modules/General/callbacks.py +++ b/src/Modules/General/callbacks.py @@ -89,6 +89,7 @@ class callbacks(callbacksOp): line=dict(color="rgb(31, 119, 180)"), name='Spikes '+ ('['+layer+']' if len(generalLayerFilter) > 1 else ''), mode='lines+markers', + marker=dict(symbol="diamond-tall", size=12), text=list(super.xAxisLabel), customdata=list(super.SpikeGraphY[layer]), hovertemplate="%{text} <br> <b>%{customdata}</b> <br> <b>Max</b> "+str( @@ -114,6 +115,7 @@ class callbacks(callbacksOp): line=dict(color="rgb(255, 127, 14)"), name='Synapses activity '+ ('['+layer+']' if len(generalLayerFilter) > 1 else ''), mode='lines+markers', + marker=dict(symbol="asterisk-open", size=12), text=list(super.xAxisLabel), customdata=list(super.SynapseGraphY[layer]), hovertemplate="<span style='color:white;'>%{text} <br> <b>%{customdata}</b> <br> <b>Max</b> "+str(super.MaxSynapse[layer]))) @@ -138,6 +140,7 @@ class callbacks(callbacksOp): line=dict(color="rgb(44, 160, 44)"), name='Neuron\'s potential '+ ('['+layer+']' if len(generalLayerFilter) > 1 else ''), mode='lines+markers', + marker=dict(symbol="diamond-wide", size=12), text=list(super.xAxisLabel), customdata=list(super.PotentialGraphY[layer]), hovertemplate="%{text} <br> <b>%{customdata}</b> <br> <b>Max</b> "+str(super.MaxPotential[layer]))) @@ -152,7 +155,7 @@ class callbacks(callbacksOp): else: super.LossGraphY.append(None) - fig = make_subplots(rows=2+(len(graphs)*3), cols=1, shared_xaxes=True, vertical_spacing=0.05, specs= + fig = make_subplots(rows=2+(len(graphs)*3), cols=1, shared_xaxes=True, vertical_spacing=0.02, specs= [[{'rowspan': 2}],[None]] + ([[{'rowspan': 3}],[None],[None]] * len(graphs))) fig.add_trace( @@ -178,7 +181,7 @@ class callbacks(callbacksOp): else: fig = make_subplots( - rows=len(graphs), cols=1, shared_xaxes=True,vertical_spacing=0.05) + rows=len(graphs), cols=1, shared_xaxes=True,vertical_spacing=0.02) l = 1 for key,graphL in graphs.items(): @@ -187,13 +190,20 @@ class callbacks(callbacksOp): graph, row=l, col=1) l +=1 - fig.update_xaxes(title_text="Step", row=(len(graphs) * 3) if g.finalLabels != None else len(graphs), col=1) + fig.update_xaxes(title_text="Step", row=(len(graphs) * 3) if g.finalLabels != None else len(graphs)) + + if len(graphs) == 1: + YAXIS = dict(yaxis=dict(range=[0, 105])) + elif len(graphs) == 2: + YAXIS = dict(yaxis1=dict(range=[0, 105]),yaxis2=dict(range=[0, 105])) + else: + YAXIS = dict(yaxis1=dict(range=[0, 105]),yaxis2=dict(range=[0, 105]),yaxis3=dict(range=[0, 105])) fig['layout'].update( - yaxis=dict(range=[0, 105]), + YAXIS, showlegend=True, uirevision='no reset of zoom', - margin={'l': 0, 'r': 0, 't': 30, 'b': 25}, + margin={'l': 0, 'r': 0, 't': 10, 'b': 0}, annotations=annotations) else: @@ -208,7 +218,7 @@ class callbacks(callbacksOp): fig.add_annotation(dict(font=dict(color='rgb(68, 71, 99)',size=15), x=0, - y=-0.12, + y=-0.10, showarrow=False, text="Epoch "+str(Epoch) if Epoch != -1 else "", textangle=0,