add: implement Optuna visualization utility with Dash
This commit is contained in:
18
src/single-core-regen/util/optuna_vis.py
Normal file
18
src/single-core-regen/util/optuna_vis.py
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
from dash import Dash, dcc, html
|
||||||
|
import logging
|
||||||
|
import dash_bootstrap_components as dbc
|
||||||
|
|
||||||
|
|
||||||
|
def show_figures(*figures):
|
||||||
|
for figure in figures:
|
||||||
|
figure.layout.template = 'plotly_dark'
|
||||||
|
|
||||||
|
app = Dash(external_stylesheets=[dbc.themes.DARKLY])
|
||||||
|
app.layout = html.Div([
|
||||||
|
dcc.Graph(figure=figure) for figure in figures
|
||||||
|
])
|
||||||
|
log = logging.getLogger('werkzeug')
|
||||||
|
log.setLevel(logging.ERROR)
|
||||||
|
|
||||||
|
app.show = lambda *args, **kwargs: app.run_server(*args, **kwargs, debug=False)
|
||||||
|
return app
|
||||||
Reference in New Issue
Block a user