Skip to content
Snippets Groups Projects

Update reports notebook

Former-commit-id: d2328bc8
parent 1941cd20
No related branches found
No related tags found
No related merge requests found
%% Cell type:markdown id: tags: %% Cell type:markdown id: tags:
German Traffic Sign Recognition Benchmark (GTSRB) German Traffic Sign Recognition Benchmark (GTSRB)
================================================= =================================================
--- ---
Introduction au Deep Learning (IDLE) - S. Arias, E. Maldonado, JL. Parouty - CNRS/SARI/DEVLOG - 2020 Introduction au Deep Learning (IDLE) - S. Arias, E. Maldonado, JL. Parouty - CNRS/SARI/DEVLOG - 2020
## Episode 5.2 : Full Convolutions Reports ## Episode 5.2 : Full Convolutions Reports
Ou main steps : Ou main steps :
- Show reports - Show reports
## 1/ Import ## 1/ Import
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` python ``` python
import pandas as pd import pandas as pd
import os,glob,json import os,glob,json
from pathlib import Path from pathlib import Path
from IPython.display import display, Markdown from IPython.display import display, Markdown
``` ```
%% Cell type:markdown id: tags: %% Cell type:markdown id: tags:
## 2/ A nice function ## 2/ A nice function
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` python ``` python
def highlight_max(s): def highlight_max(s):
is_max = (s == s.max()) is_max = (s == s.max())
return ['background-color: yellow' if v else '' for v in is_max] return ['background-color: yellow' if v else '' for v in is_max]
def show_report(file): def show_report(file):
# ---- Read json file # ---- Read json file
with open(file) as infile: with open(file) as infile:
dict_report = json.load( infile ) dict_report = json.load( infile )
output = dict_report['output'] output = dict_report['output']
description = dict_report['description'] description = dict_report['description']
# ---- about # ---- about
print("\n\n\nReport : ",Path(file).stem) print("\n\n\nReport : ",Path(file).stem)
print( "Desc. : ",description,'\n') print( "Desc. : ",description,'\n')
# ---- Create a pandas # ---- Create a pandas
report = pd.DataFrame (output) report = pd.DataFrame (output)
col_accuracy = [ c for c in output.keys() if c.endswith('Accuracy')] col_accuracy = [ c for c in output.keys() if c.endswith('Accuracy')]
col_duration = [ c for c in output.keys() if c.endswith('Duration')] col_duration = [ c for c in output.keys() if c.endswith('Duration')]
# ---- Build formats # ---- Build formats
lambda_acc = lambda x : '{:.2f} %'.format(x) if (isinstance(x, float)) else '{:}'.format(x) lambda_acc = lambda x : '{:.2f} %'.format(x) if (isinstance(x, float)) else '{:}'.format(x)
lambda_dur = lambda x : '{:.1f} s'.format(x) if (isinstance(x, float)) else '{:}'.format(x) lambda_dur = lambda x : '{:.1f} s'.format(x) if (isinstance(x, float)) else '{:}'.format(x)
formats = {'Size':'{:.2f} Mo'} formats = {'Size':'{:.2f} Mo'}
for c in col_accuracy: for c in col_accuracy:
formats[c]=lambda_acc formats[c]=lambda_acc
for c in col_duration: for c in col_duration:
formats[c]=lambda_dur formats[c]=lambda_dur
t=report.style.highlight_max(subset=col_accuracy).format(formats).hide_index() t=report.style.highlight_max(subset=col_accuracy).format(formats).hide_index()
display(t) display(t)
``` ```
%% Cell type:markdown id: tags: %% Cell type:markdown id: tags:
## 3/ Reports display ## 3/ Reports display
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` python ``` python
for file in glob.glob("./run/*.json"): for file in glob.glob("./run/*.json"):
show_report(file) show_report(file)
``` ```
%% Output %% Output
Report : report_2020_01_20_17h22m23s Report : report_2020_01_20_17h22m23s
Desc. : train_size=1 test_size=1 batch_size=64 epochs=16 data_aug=False Desc. : train_size=1 test_size=1 batch_size=64 epochs=16 data_aug=False
Report : report_020341
Desc. : train_size=1 test_size=1 batch_size=64 epochs=16 data_aug=False
Report : report_009557
Desc. : train_size=1 test_size=1 batch_size=64 epochs=16 data_aug=False
Report : report_093384
Desc. : train_size=1 test_size=1 batch_size=64 epochs=16 data_aug=False
Report : report_094801
Desc. : train_size=1 test_size=1 batch_size=64 epochs=20 data_aug=True
Report : report_041040
Desc. : train_size=1 test_size=1 batch_size=64 epochs=20 data_aug=True
Report : report_088809
Desc. : train_size=1 test_size=1 batch_size=64 epochs=20 data_aug=True
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` python ``` python
``` ```
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` python ``` python
``` ```
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment