src.model.deeplearn.sequencer.dl_sequencer
Classes
|
- 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:
- 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.
- 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)
- getitem_training(idx)
- getitem_predict(idx)
- 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()
- apply_random_indices()