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

# %run -i 'PyFiles/imports.py'
# %run -i 'PyFiles/helpers.py'
# %run -i "PyFiles/experiment.py"
# %run -i "PyFiles/analysis.py"
import scipy.stats as stats
import glob

# +
medium_path_list = glob.glob('experiment_results/medium/*/*.txt')
test_analysis = EchoStateAnalysis([medium_path_list[0]], 
                                  model = "uniform", 
                                  ip_use_observers = True, 
                                  ip_method = "linear")

json_obj_test = test_analysis.experiment_lst[0]
test_experiment = test_analysis.get_experiment(json_obj_test, model = "uniform")
# -

json_obj_test["best arguments"]

test_esn = test_experiment.esn_spec
test2_esn = EchoStateNetwork(**json_obj_test["best arguments"]["exponential"],
                             resp_idx = json_obj_test["resp_idx"],
                             obs_idx = json_obj_test["obs_idx"],
                             exponential = False, plot = True, 
                             llambda2 = 10**(-2), model_type = "exponential")
test2_esn.noise = 0.5
test2_esn.get_exp_weights()

test_esn = test_experiment.esn_spec
test2_esn = EchoStateNetwork(**json_obj_test["best arguments"]["exponential"],
                             resp_idx = json_obj_test["resp_idx"],
                             obs_idx = json_obj_test["obs_idx"],
                             exponential = False, plot = True,
                             llambda2 = 0.0001, model_type = "exponential")
test2_esn.noise = 0.1
test2_esn.get_exp_weights()

test_esn = test_experiment.esn_spec
test2_esn = EchoStateNetwork(**json_obj_test["best arguments"]["exponential"],
                             resp_idx = json_obj_test["resp_idx"],
                             obs_idx = json_obj_test["obs_idx"],
                             exponential = False, plot = True, model_type = "exponential",
                             llambda2 = 10)
test2_esn.noise = 0.5
test2_esn.get_exp_weights()

normal_error = np.random.normal(loc = 0, scale = 0.01, size = (10,3))
exp_weights1to3 = test2_esn.exp_weights[:3]
print(exp_weights1to3 )
exp_weights1to3 + normal_error

StarcoderdataJupyterScriptsDedupFiltered