-
Notifications
You must be signed in to change notification settings - Fork 1
/
run_experiments.sh
executable file
·51 lines (40 loc) · 1.92 KB
/
run_experiments.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/bin/bash
# =========================================================
# The experiment is to try to evoke ripples from 100 to 300
# ms. The original model can do this with endogenous inputs.
# We will use that ripple as the target for closed-loop
# control after fitting a model to training data.
# =========================================================
function get_last_dir () {
echo "$(ls -tp | grep /$ | head -1)"
}
# check that aussel_model is working
python run_sim.py --smoke --show_plots
# to get 3D figure
python run_sim.py --runtime=0 --show_plots --mode=OLconst --opto_slice
# original
# --f1=5 yields 200-ms pulse
python run_sim.py --f1=5 --runtime=0.4 --mode=orig --target=cython
ln -s "$(get_last_dir)" orig_results
# naïve open-loop
# --ref determines shape of stimulus
python run_sim.py --mode=OLnaive --ref=orig_results/tklfp.npy --n_trials=10 --target=cython --noise
ln -s "$(get_last_dir)" olnaive_results
# fit
# I just happened to use 13 seconds of training data
python run_sim.py --mode=fit --runtime=13 --target=cython --noise
ln -s "$(get_last_dir)" fit_results
python fit_data.py fit_results --out=fit_results/fit.npz --iterEM=1000
# LQR
python run_sim.py --mode=LQR --fit=fit_results/fit.npz --ref=orig_results/tklfp.npy --n_trials=10 --target=cython --noise
ln -s "$(get_last_dir)" lqr_results
# MPC
python run_sim.py --mode=MPC --fit=fit_results/fit.npz --ref=orig_results/tklfp.npy --n_trials=10 --target=cython --noise
ln -s "$(get_last_dir)" mpc_results
# ======================================================================
# Validation, reproducing epilepsy figure from Aussel 2022 figure 5
# ======================================================================
python run_sim.py --mode=val-epi --runtime=35 --target=cython
ln -s "$(get_last_dir)" val_epi_results
python run_sim.py --mode=val-healthy --runtime=35 --target=cython
ln -s "$(get_last_dir)" val_healthy_results