deepblink
stable
  • deepblink.augment module
  • deepblink.cli package
  • deepblink.data module
  • deepblink.datasets package
    • Submodules
      • deepblink.datasets.sequence module
      • deepblink.datasets.spots module
    • Module contents
  • deepblink.inference module
  • deepblink.io module
  • deepblink.losses module
  • deepblink.metrics module
  • deepblink.models package
  • deepblink.networks package
  • deepblink.optimizers module
  • deepblink.training module
  • deepblink.util module
deepblink
  • »
  • deepblink.datasets package
  • Edit on GitHub

deepblink.datasets package¶

Submodules¶

  • deepblink.datasets.sequence module
  • deepblink.datasets.spots module

Module contents¶

Datasets module with classes to handle data import and data presentation for training.

class deepblink.datasets.Dataset(name: str, *_)[source]¶

Bases: object

Simple abstract class for datasets.

Parameters:name – Absolute path to dataset file.
data_filename¶

Return the absolute path to the dataset.

load_data()[source]¶

Empty method to import or create data.

normalize_dataset()[source]¶

Empty method to normalise images in the dataset.

prepare_data()[source]¶

Empty method to prepare or convert data.

class deepblink.datasets.SequenceDataset(x: numpy.ndarray, y: numpy.ndarray, batch_size: int = 16, augment_fn: Callable = None, format_fn: Callable = None, overfit: bool = False)[source]¶

Bases: keras.utils.data_utils.Sequence

Custom Sequence class used to feed data into model.fit.

Parameters:
  • x_list – List of inputs.
  • y_list – List of targets.
  • batch_size – Size of one mini-batch.
  • augment_fn – Function to augment one mini-batch of x and y.
  • format_fn – Function to format raw data to model input.
  • overfit – If only one batch should be used thereby causing overfitting.
on_epoch_end() → None[source]¶

Shuffle data after every epoch.

class deepblink.datasets.SpotsDataset(name: str, cell_size: int, smooth_factor: float = 1)[source]¶

Bases: deepblink.datasets._datasets.Dataset

Class used to load all spots data.

Parameters:
  • cell_size – Number of pixels (from original image) constituting one cell in the prediction matrix.
  • smooth_factor – Value used to weigh true cells, weighs false cells with 1-smooth_factor.
image_size¶

Check if all images have the same square shape.

load_data() → None[source]¶

Load dataset into memory.

normalize_dataset() → None[source]¶

Normalize all the images to have zero mean and standard deviation 1.

prepare_data() → None[source]¶

Convert raw labels into labels usable for training.

In the “spots” format, training labels are stored as lists of coordinates, this format cannot be used for training. Here, this format is converted into prediction matrices.

Next Previous

© Copyright 2020, Bastian Eichenberger Revision 9152b5b1.

Built with Sphinx using a theme provided by Read the Docs.