# General Settings Pick n_rounds = 1 n_summary = 9 n_samples = 10 n_hiddens = [200, 200] n_components = 1 dt = 0.01 # Get current I, t, t_on, t_off = syn_current(duration=70, dt=0.01, t_on=15, t_off=20, amp=3.1) params, labels = obs_params() params[0] *= 10 print(params) # Set up themodel dap = DAPcython(-75, params) U = dap.simulate(dt, t, I) # generate data format for SNPE / OBSERVABLE x_o = {'data': U, 'time': t, 'dt': dt, 'I': I} # Prior # Setup Priors prior_min = np.array([0, 1]) prior_max = np.array([2, 30]) prior_unif = Uniform(lower=prior_min, upper=prior_max)
# General Settings Pick n_rounds = 1 n_summary = 17 n_samples = 5 n_hiddens = [15] n_components = 1 dt = 0.01 reg_lambda = 0.01 n_params = 2 # Load the current data_dir = '/home/alteska/Desktop/LFI_DAP/data/rawData/2015_08_26b.dat' # best cell I, v, t, t_on, t_off, dt = load_current(data_dir, protocol='IV', ramp_amp=1) params, labels = obs_params(reduced_model=True) print(params) print(labels) # Set up themodel dap = DAPcython(-75, params) U = dap.simulate(dt, t, I) # generate data format for SNPE / OBSERVABLE x_o = {'data': U.reshape(-1), 'time': t, 'dt': dt, 'I': I} # Setup Priors prior_min, prior_max, labels = load_prior_ranges(n_params)
import glob import shutil import pandas as pd from tqdm import tqdm from scipy.spatial import distance from dap import DAPcython from dap.utils import obs_params, load_current from utils import calc_features_ramp, calc_features_step import warnings warnings.filterwarnings("ignore") dt = 1e-2 params, labels = obs_params(reduced_model=False) data_dir = '/home/alteska/Desktop/LFI_DAP/data/rawData/2015_08_26b.dat' # load the file directory = './parameters/' dir = glob.glob(directory + '*') fname_start = dir[0].find('dap_') fname_stop = dir[0].find('n_') fname = dir[0][fname_start:fname_stop] df_param = pd.read_csv(fname + '.csv') df_param.set_index('Unnamed: 0', inplace=True) # calculate DAP # load the input data Ir, vr, tr, t_onr, t_offr, dtr = load_current(data_dir,