# ---
# jupyter:
#   jupytext:
#     text_representation:
#       extension: .py
#       format_name: light
#       format_version: '1.5'
#       jupytext_version: 1.14.4
#   kernelspec:
#     display_name: dl_kolm_env
#     language: python
#     name: dl_kolm_env
# ---

# ## Run experiments
#
# Specify the number of gpus per trial and run different experiments.
#
# - `avg_xyz`: 4 independent runs for the black scholes model/heat equations (paraboloid/Gaussian initial condition)/basket option
# - `compare_xyz`: compare networks for the black scholes model/heat equation (paraboloid initial condition)
# - `dims_heat_paraboloid`: compare the cost w.r.t. varying input dimension for the heat equation (paraboloid initial condition)
# - `optimize_bs`: hyperparameter search for the black scholes model
# - `compare_freeze`: compare freezing strategies for the black scholes model
#
# ... or add your favorite experiment to `HYPERCONFIGS` in `deep_kolmogorov/trainer`.

from deep_kolmogorov import utils
run_widget = utils.get_run_widget()
run_widget

# !python main.py --mode={run_widget.children[0].value} --gpus={run_widget.children[1].value}

# optional: individual experiment
# !python main.py --help

# ## Analyze experiments
#
# Choose a finished/precomputed experiment to analyze.

from deep_kolmogorov import utils
exp_widget = utils.get_exp_widget()
exp_widget

# ### Tensorboard
#
# Open tensorboard to analyze the experiment.

# %load_ext tensorboard
# %tensorboard --logdir '{exp_widget.value._experiment_dir}'

# ### Tables
#
# Output tables for the chosen experiment.

utils.visualize_exp(exp_widget.value, show_only_final=False)

# ### Black-Scholes Model approximation
#
# Choose the 'avg_bs' experiment and plot the approximation to the analytic solutions.

utils.get_bs_widget(exp_widget.value)

StarcoderdataJupyterScriptsDedupFiltered