From c08103a0011856639ffd354bc371740b9dec856d Mon Sep 17 00:00:00 2001 From: kapoorlab Date: Mon, 27 Nov 2023 13:59:01 +0100 Subject: [PATCH] mitosis shape and dynamics --- src/napatrackmater/Trackvector.py | 15 +++++++++------ src/napatrackmater/_version.py | 4 ++-- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/napatrackmater/Trackvector.py b/src/napatrackmater/Trackvector.py index f0f71ad8..34e62735 100644 --- a/src/napatrackmater/Trackvector.py +++ b/src/napatrackmater/Trackvector.py @@ -444,13 +444,13 @@ def plot_mitosis_times(self, full_dataframe, save_path=""): f"{save_path}_{column}_Number_Dividing_{i}.npy", data.to_numpy() ) - all_split_data = [] + all_split_data = [] for split_id in self.split_cell_ids: spot_properties = self.unique_spot_properties[split_id] track_id = spot_properties[self.trackid_key] unique_id = spot_properties[self.uniqueid_key] tracklet_id = spot_properties[self.trackletid_key] - number_times_divided = spot_properties[self.number_dividing_key] + number_times_divided = spot_properties[self.number_dividing_key] surface_area = spot_properties[self.surface_area_key] eccentricity_comp_first = spot_properties[self.eccentricity_comp_firstkey] eccentricity_comp_second = spot_properties[self.eccentricity_comp_secondkey] @@ -481,9 +481,7 @@ def plot_mitosis_times(self, full_dataframe, save_path=""): } all_split_data.append(data) - np.save( - f"{save_path}_data_at_mitosis_time.npy", all_split_data - ) + np.save(f"{save_path}_data_at_mitosis_time.npy", all_split_data) def get_shape_dynamic_feature_dataframe(self): @@ -1453,7 +1451,12 @@ def train_mitosis_neural_net( running_val_loss_class1 += loss_class1.item() running_val_loss_class2 += loss_class2.item() pbar_val.set_postfix( - {"Acc Class1": accuracy_class1, "Acc Class2": accuracy_class2} + { + "Acc Class1": accuracy_class1, + "Acc Class2": accuracy_class2, + "Class1 Loss": running_val_loss_class1 / (i + 1), + "Class2 Loss": running_val_loss_class2 / (i + 1), + } ) val_loss_class1_values.append(running_val_loss_class1 / len(val_loader)) diff --git a/src/napatrackmater/_version.py b/src/napatrackmater/_version.py index 01e6bcfc..e77530e0 100644 --- a/src/napatrackmater/_version.py +++ b/src/napatrackmater/_version.py @@ -1,2 +1,2 @@ -__version__ = version = "4.4.8" -__version_tuple__ = version_tuple = (4, 4, 8) +__version__ = version = "4.4.9" +__version_tuple__ = version_tuple = (4, 4, 9)