ladder.data.real_data.distrib_dataset#
- ladder.data.real_data.distrib_dataset(dataset, levels, split_pcts=None, batch_size=128, keep_train=None, keep_test=None, batch_key=None, **kwargs)#
Function that distributes the
TensorDatasetgenerated byconstruct_labels.- Parameters:
dataset (
TensorDataset) – Thedatasetoutput fromconstruct_labels.levels (
dict) – Thelevelsoutput fromconstruct_labels.split_pcts (array_like, optional) – Size 2 list of
floatspecifying the proportions for training and test respectively. Ignored if bothkeep_trainandkeep_testare notNone.batch_size (
int) – Mini-batch size for the models to train on.keep_train (array_like, optional) – 1D Array-like of
str. Specifies the levels to keep in the training dataset. Elements must be fromlevels.keys().keep_test (array_like, optional) – 1D Array-like of
str. Specifies the levels to keep in the test dataset. Elements must be fromlevels.keys().batch_key (
str, optional) – Must not beNoneifbatch_keywas previously provided toconstruct_labels. The actual values is unimportant for this scope.**kwargs (
dict, optional) – Keyword arguments passed toutils.DataLoader.
- Return type:
- Returns:
- train_set
TensorDatasetor ConcatTensorDataset The full training set to be used downstream.
- test_set
TensorDatasetor ConcatTensorDataset The full test set to be used downstream.
- train_loader
DataLoader The corresponding loader for
train_set.- test_loader
DataLoader The corresponding loader for
test_set.- l_mean
floator array_like If
batch_keyis provided, the empirical library size log-mean for each batch (1-D Array-like offloat). A single value otherwise.- l_scale
floator array_like If
batch_keyis provided, then the empirical library size log-variance for each batch (1-D Array-like offloat). A single value otherwise.
- train_set