DataModule
- class aixd.mlmodel.data.data_loader.DataModule(*args: Any, **kwargs: Any)[source]
Bases:
LightningDataModule
Data module for the ML model. It takes care of splitting the data into train, val and test sets, normalizing the data.
- Parameters:
input_ml_dblock (InputML) – Input data block, defining normalizations, the type of the input data, and the heads for the ML model.
output_ml_dblock (OutputML) – Output data block, defining normalizations, the type of the output data, and the heads for the ML model.
x (Union[np.ndarray, torch.Tensor]) – The input fata matrix.
y (Union[np.ndarray, torch.Tensor]) – The output data matrix.
batch_size (int, optional) – Batch size. The default is 512.
split_ratios (List[Union[int, float]], optional) – List of ratios for splitting the data into train, val and test sets. The default is [0.8, 0.1, 0.1].
random_seed (int, optional) – Random seed for splitting the data. The default is RANDOM_SEED_SPLIT.
predict (bool, optional) – Whether to create a predict set. The default is False.
Methods
Converts input and output data to a dataloader.
Creates a data module from a dataset.
Creates a data module from parameters returned by the get_parameters(...) method.
Computes a checksum for the training/validation/test data.
Get parameters defining the data module.
Unnormalize the input and output data.
Unnormalize only the input data.
Un-transform only the output data.
Calculates the dimensions of the input and output of the ML model.
Transform the input and output data.
Transform only the input data.
Transform only the output data.