src.model.deeplearn.sequencer.dl_sequencer

Classes

DLSequencer(X, y, batch_size, **kwargs)

class src.model.deeplearn.sequencer.dl_sequencer.DLSequencer(X, y, batch_size, **kwargs)
Author:

Alberto M. Esmoris Pena

A deep learning sequencer that governs how the input data is fed to a neural network. It handles two main points:

  1. Memory management: Explicitly take control of the memory handling

    logic to prevent undesired scenarios, e.g., InternalError, or memory exhaustion due to TensorFlow loading the full array of batches into the GPU memory.

  2. Data augmentation: Provides rotations around an arbitrary axis,

    jitter, and scaling through SimpleDataAugmentor. Besides, it also enables random shuffle of the indices to unbias the training process wrt the initial input order.

See DLAbstractSequencer.

Variables:
  • X – The input data.

  • y – The input reference values.

  • arch (Architecture) – The neural network architecture.

  • batch_size (int) – The number of elements per batch.

__init__(X, y, batch_size, **kwargs)

Initialize the member attributes of the DLSequencer.

Parameters:
  • X – The input data.

  • y – The input reference values.

  • batch_size (int) – The number of elements per batch.

  • kwargs – The key-word specification to parametrize the sequencer.

augment(batch_X)

See DLAbstractSequencer.augment().

getitem_training(idx)

See DLAbstractSequencer.getitem_training()

getitem_predict(idx)

See DLAbstractSequencer.getitem_predict().

on_epoch_end_training()

See DLAbstractSequencer.on_epoch_end_training().

find_augmentation_elements(batch_X)

Find the indices of the elements in the batch that must be considered for data augmentation. Note that these indices will depend on the underlying neural network architecture.

Parameters:

batch_X (list or np.ndarray) – The input batch that must be augmented.

Returns:

List of indices representing the elements that must be considered for data augmentation.

Return type:

list of int

init_random_indices()

See DLAbstractSequencer.init_random_indices().

apply_random_indices()

See DLAbstractSequencer.apply_random_indices().