Source: keras_text/generators.py#L0


ProcessingSequence


ProcessingSequence.__init__

__init__(self, X, y, batch_size, process_fn=None)

A Sequence implementation that can pre-process a mini-batch via process_fn

Args:

  • X: The numpy array of inputs.
  • y: The numpy array of targets.
  • batch_size: The generator mini-batch size.
  • process_fn: The preprocessing function to apply on X

ProcessingSequence.on_epoch_end

on_epoch_end(self)

BalancedSequence


BalancedSequence.__init__

__init__(self, X, y, batch_size, process_fn=None)

A Sequence implementation that returns balanced y by undersampling majority class.

Args:

  • X: The numpy array of inputs.
  • y: The numpy array of targets.
  • batch_size: The generator mini-batch size.
  • process_fn: The preprocessing function to apply on X

BalancedSequence.on_epoch_end

on_epoch_end(self)