BatchProcessor#

Batch processor class for data preprocessing.

This class provides methods for preprocessing a batch of data including sum normalization, and properties for accessing batch-related information.

Batch Items:#

  1. t - time. always required

  2. X - data. tensor of size: [batch_size, len(t), n_dim]. always required.

  3. W - weight. tensor of size: [batch_size, len(t), 1]

  4. F_idx - fate_idx. tensor of size: [batch_Size, len(t), 1]

scdiffeq.core.lightning_models.base._batch_processor.BatchProcessor.None#
scdiffeq.core.lightning_models.base._batch_processor.BatchProcessor._sum_normalize()#

Normalize the input tensor by sum along a specified axis.

scdiffeq.core.lightning_models.base._batch_processor.BatchProcessor.__repr__()#

Generate the textual representation of the batch.

Properties:

device: Get the device of the batch. n_batch_items: Get the number of items in the batch. batch_size: Get the batch size. t: Get unique time steps in the batch. X: Get the data tensor. X0: Get the initial data tensor. W_hat: Get the predicted weight tensor. W: Get the normalized weight tensor. F_idx: Get the fate index tensor if available.

scdiffeq.core.lightning_models.base._batch_processor.BatchProcessor.__delattr__(self, name, /)#

Implement delattr(self, name).

scdiffeq.core.lightning_models.base._batch_processor.BatchProcessor.__dir__(self, /)#

Default dir() implementation.

scdiffeq.core.lightning_models.base._batch_processor.BatchProcessor.__eq__(self, value, /)#

Return self==value.

scdiffeq.core.lightning_models.base._batch_processor.BatchProcessor.__format__(self, format_spec, /)#

Default object formatter.

Return str(self) if format_spec is empty. Raise TypeError otherwise.

scdiffeq.core.lightning_models.base._batch_processor.BatchProcessor.__ge__(self, value, /)#

Return self>=value.

scdiffeq.core.lightning_models.base._batch_processor.BatchProcessor.__getattribute__(self, name, /)#

Return getattr(self, name).

scdiffeq.core.lightning_models.base._batch_processor.BatchProcessor.__getstate__(self, /)#

Helper for pickle.

scdiffeq.core.lightning_models.base._batch_processor.BatchProcessor.__gt__(self, value, /)#

Return self>value.

scdiffeq.core.lightning_models.base._batch_processor.BatchProcessor.__hash__(self, /)#

Return hash(self).

scdiffeq.core.lightning_models.base._batch_processor.BatchProcessor.__init_subclass__()#

This method is called when a class is subclassed.

The default implementation does nothing. It may be overridden to extend subclasses.

scdiffeq.core.lightning_models.base._batch_processor.BatchProcessor.__le__(self, value, /)#

Return self<=value.

scdiffeq.core.lightning_models.base._batch_processor.BatchProcessor.__lt__(self, value, /)#

Return self<value.

scdiffeq.core.lightning_models.base._batch_processor.BatchProcessor.__ne__(self, value, /)#

Return self!=value.

scdiffeq.core.lightning_models.base._batch_processor.BatchProcessor.__new__(*args, **kwargs)#

Create and return a new object. See help(type) for accurate signature.

scdiffeq.core.lightning_models.base._batch_processor.BatchProcessor.__reduce__(self, /)#

Helper for pickle.

scdiffeq.core.lightning_models.base._batch_processor.BatchProcessor.__reduce_ex__(self, protocol, /)#

Helper for pickle.

scdiffeq.core.lightning_models.base._batch_processor.BatchProcessor.__setattr__(self, name, value, /)#

Implement setattr(self, name, value).

scdiffeq.core.lightning_models.base._batch_processor.BatchProcessor.__sizeof__(self, /)#

Size of object in memory, in bytes.

scdiffeq.core.lightning_models.base._batch_processor.BatchProcessor.__str__(self, /)#

Return str(self).

scdiffeq.core.lightning_models.base._batch_processor.BatchProcessor.__subclasshook__()#

Abstract classes can override this to customize issubclass().

This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).