deepcinac.cinac_movie_patch
¶
Module Contents¶
Classes¶
Used to generate movie patches, that will be produce for training data during each mini-batch. |
|
Used to generate movie patches, that will be produce for training data during each mini-batch. |
|
Will generate one input being the masked cell (the one we focus on), the second input |
|
Based on an exemple found in https://stanford.edu/~shervine/blog/keras-how-to-generate-data-on-the-fly |
Attributes¶
- deepcinac.cinac_movie_patch.TF_VERSION¶
- class deepcinac.cinac_movie_patch.MoviePatchGenerator(window_len, max_width, max_height, using_multi_class, cell_type_classifier_mode)¶
Used to generate movie patches, that will be produce for training data during each mini-batch. This is an abstract classes that need to have heritage. The function generate_movies_from_metadata will be used to produced those movie patches, the number vary depending on the class instantiated
- get_nb_inputs()¶
- generate_movies_from_metadata(movie_data_list, memory_dict, with_labels=True)¶
- class deepcinac.cinac_movie_patch.MoviePatchGeneratorForCellType(window_len, max_width, max_height, pixels_around, buffer, using_multi_class, cell_type_classifier_mode, with_all_pixels=False)¶
Bases:
MoviePatchGenerator
Used to generate movie patches, that will be produce for training data during each mini-batch. This is an abstract classes that need to have heritage. The function generate_movies_from_metadata will be used to produced those movie patches, the number vary depending on the class instantiated
- generate_movies_from_metadata(movie_data_list, memory_dict=None, with_labels=True)¶
- Parameters
movie_data_list – list of MoviePatchData instances
memory_dict –
with_labels –
Returns:
- __str__()¶
Return str(self).
- class deepcinac.cinac_movie_patch.MoviePatchGeneratorMaskedVersions(window_len, max_width, max_height, pixels_around, buffer, with_neuropil_mask, using_multi_class, cell_type_classifier_mode)¶
Bases:
MoviePatchGenerator
Will generate one input being the masked cell (the one we focus on), the second input would be the whole patch without neuorpil and the main cell, the last inpu if with_neuropil_mask is True would be just the neuropil without the pixels in the cells
- generate_movies_from_metadata(movie_data_list, memory_dict=None, with_labels=True)¶
- Parameters
movie_data_list – list of MoviePatchData instances
memory_dict –
with_labels –
Returns:
- __str__()¶
Return str(self).
- class deepcinac.cinac_movie_patch.MoviePatchData(cinac_recording, cell, index_movie, max_n_transformations, encoded_frames, decoding_frame_dict, window_len, cell_type_classifier_mode=False, session_id=None, with_info=False, to_keep_absolutely=False, ground_truth=None)¶
- n_available_augmentation_fct¶
Keys so far for self.movie_info (with value type) -> comments:
n_transient (int) transients_lengths (list of int) transients_amplitudes (list of float) n_cropped_transient (int) -> max value should be 2 cropped_transients_lengths (list of int) n_fake_transient (int) n_cropped_fake_transient (int) > max value should be 2 fake_transients_lengths (list of int) fake_transients_amplitudes (list of float)
- get_labels(using_multi_class)¶
Return the labels for this data, could be if the cell is active for any given frame or the cell type depending on the classifier mode :param using_multi_class:
Returns:
- __eq__(other)¶
Return self==value.
- copy()¶
- add_n_augmentation(n_augmentation)¶
- pick_a_transformation_fct()¶
- is_only_neuropil()¶
- Returns
True if there is only neuropil (no transients), False otherwise
- class deepcinac.cinac_movie_patch.DataGenerator(data_list, movie_patch_generator, batch_size, window_len, with_augmentation, pixels_around, buffer, max_width, max_height, is_shuffle=True)¶
Bases:
tensorflow.keras.utils.Sequence
Based on an exemple found in https://stanford.edu/~shervine/blog/keras-how-to-generate-data-on-the-fly Feed to keras to generate data
- prepare_augmentation()¶
- __len__()¶
- __getitem__(index)¶
- on_epoch_end()¶
- __data_generation(data_list_tmp)¶