optimization / old_code /optimisation.py
joel-woodfield's picture
Add old code from gradio version
9357e05
import gradio as gr
from bivariate import Bivariate
from univariate import Univariate
class Optimisation:
def __init__(self, width=1200, height=900):
self.width = width
self.height = height
self.univariate = Univariate(width, height)
self.bivariate = Bivariate(width, height)
def on_load(self):
self.univariate.reset()
self.bivariate.reset()
def launch(self):
with gr.Blocks() as demo:
gr.HTML("<div style='text-align:left; font-size:40px; font-weight: bold;'>Optimisation trajectory visualizer</div>")
self.univariate.build()
self.bivariate.build()
demo.load(self.on_load)
demo.launch()
visualizer = Optimisation(width=1200, height=900)
visualizer.launch()