fit final dataset again (3) add skipping already fitted ones

This commit is contained in:
alexanderott 2020-09-13 18:49:59 +02:00
parent d0cfd795d1
commit 63d1547f97
3 changed files with 10 additions and 5 deletions

View File

@ -346,7 +346,7 @@ class Fitter:
self.base_model.set_variable("v_offset", v_offset)
# time2 = time.time()
# print("time taken for finding v_offset: {:.2f}s".format(time2-time1))
print(self.base_model.parameters)
error_list = self.calculate_errors(error_weights)
# print("sum: {:.2f}, ".format(sum(error_list)))
if sum(error_list) < self.smallest_error:

View File

@ -14,8 +14,8 @@ from helperFunctions import plot_errors
import multiprocessing as mp
SAVE_DIRECTORY = "./results/ref_and_tau/with_out_both/"
SAVE_DIRECTORY_BEST = "./results/ref_and_tau/wob_best/"
SAVE_DIRECTORY = "./results/final_3"
SAVE_DIRECTORY_BEST = "./results/final_3_best/"
# [vs, sc, cv, isi_hist, bursty, f_inf, f_inf_slope, f_zero, f_zero_slope, f0_curve]
ERROR_WEIGHTS = (1, 1, 1, 1, 1, 1, 1, 1, 0, 1)
@ -26,6 +26,11 @@ def main():
args = parser.parse_args()
if args.cell is not None:
cell_data = CellData(args.cell)
cell_name = os.path.split(cell_data.get_data_path())[-1]
if os.path.exists(SAVE_DIRECTORY + "/" + cell_name + "/"):
print(cell_name, "already done")
return
start_parameters = [p for p in iget_start_parameters()]
fit_cell_parallel(cell_data, start_parameters)
quit()
@ -60,7 +65,7 @@ def fit_cell_base(parameters):
time1 = time.time()
fitter = Fitter()
fitter.set_data_reference_values(parameters[0])
fmin, res_par = fitter.fit_routine_no_dend_tau_and_no_ref_period(parameters[2], ERROR_WEIGHTS)
fmin, res_par = fitter.fit_routine(parameters[2], ERROR_WEIGHTS)
cell_data = parameters[0]
cell_name = os.path.split(cell_data.get_data_path())[-1]

View File

@ -1,5 +1,5 @@
for file in data/ref_and_dend_set/*; do
for file in data/final/*; do
if [ -d "$file" ]; then
nice python3 run_Fitter.py --cell $file
fi