# Set up parameters using prior information about them (fix the range we are assuming the true parameter) prior_params = [] for idx, item in enumerate(p_names): prior_params.append( RandomVariable(name=item, range_min=p_range[idx][0], range_max=p_range[idx][1], resolution=p_res[idx], sigma=p_std[idx], mean=p_mean[idx])) prior_set = ParameterSet(*prior_params) prior_set.batch_len = batch_size if batch_size is not None: prior_set.isBatch = True else: prior_set.isBatch = False prior_set.create_batch() # Create fixed params sampled from prior fixed_params = sampling_from_prior(prior_set, fixed_param_num) # Save parameter informations # Create database for data database = tb.open_file( "/Users/Dani/TDK/parameter_estim/stim_protocol2/comb_colored_srsoma-rdend_gpas-dens/paramsetup.hdf5", mode="w") # Save param initialization param_init = []
model = stick_and_ball batch_size = 30000 # Set up random seed np.random.seed(42) # Set up parameters using prior information about them (fix the range we are assuming the true parameter) prior_params = [] for idx, item in enumerate(p_names): prior_params.append(RandomVariable(name=item, range_min=p_range[idx][0], range_max=p_range[idx][1], resolution=p_res[idx], sigma=p_std[idx], mean=p_mean[idx])) prior_set = ParameterSet(*prior_params) prior_set.batch_len = batch_size prior_set.isBatch = True prior_set.create_batch() # Create fixed params sampled from prior fixed_params = sampling_from_prior(prior_set, fixed_param_num) # Save parameter informations # Create database for data database = tb.open_file("/Users/Dani/TDK/parameter_estim/stim_protocol2/combining3/paramsetup.hdf5", mode="w") # Save param initialization param_init = [] for param in prior_set.params: param_init.append(param.get_init()) param_init = np.array(param_init, dtype=str)