Distribution-based dataloaders

Dataloaders that return data by sampling from some pre-defined distributions.

source

BaseDistributionDataLoader

 BaseDistributionDataLoader ()

Base class for data loaders. The idea of the data loader is to provide all external information to the environment (including lagged data, demand etc.). Internal data influenced by past decisions (like inventory levels) is to be added from within the environment


source

NormalDistributionDataLoader

 NormalDistributionDataLoader (mean:float, std:float, num_units:int,
                               truncated_low:int=0,
                               truncated_high:int=None)

A dataloader that generates a dataset of normally distributed values.

Type Default Details
mean float
std float
num_units int
truncated_low int 0
truncated_high int None
dataloader = NormalDistributionDataLoader(mean=3, std=4, num_units=2)

sample_X, sample_Y = dataloader[0]
print("sample:", sample_X, sample_Y)
print("sample shape Y:", sample_Y.shape)

## The next print should give an error:
#print("length:", len(dataloader))
sample: None [0. 0.]
sample shape Y: (2,)
dataloader.train()
dataloader.val()
dataloader.test()