SyntheticDataset¶
- class itergp.datasets.SyntheticDataset(rng_state, size, input_shape=(), output_shape=(), fun=<function SyntheticDataset.<lambda>>, noise_var=0.1, range_X=[-1.0, 1.0])¶
Bases:
DatasetSynthetically generated dataset.
Generate a dataset from random input data, a ground truth function and additive noise.
- Parameters
rng_state (backend.random.RNGState) – State of the random number generator.
size (Tuple[int, int]) – Size of the dataset. Tuple of training and test dataset size.
input_shape (ShapeLike) – Shape of the inputs.
output_shape (ShapeLike) – Shape of the outputs.
fun (Callable[[backend.Array], backend.Array]) – Ground truth function generating the data (without noise).
noise_std – Standard deviation of the Gaussian noise added to the value of
true_fn.range_X (Tuple[float, float]) – Maximum and minimum value for the generated inputs.
noise_var (float) –
Examples
>>> from probnum import backend >>> from itergp import datasets ... >>> rng_state = backend.random.rng_state(42) >>> data = datasets.SyntheticDataset(rng_state=rng_state, size=(100, 10), input_shape=2) >>> data.train.X.shape (100, 2)
Attributes Summary
Input shape of the data.
Output shape of the data.
Test data.
Training data.
Methods Summary
from_disk(dir)resample(rng_state)Resample the training and test set from the entire data set.
save([dir, overwrite])Save dataset to disk.
Attributes Documentation
- fun¶
- input_shape¶
Input shape of the data.
- output_shape¶
Output shape of the data.
- test¶
Test data.
- train¶
Training data.
Methods Documentation
- resample(rng_state)¶
Resample the training and test set from the entire data set.
Randomly selects new datapoints for the training and test set of the same sizes as the original dataset.
- Parameters
rng_state (SeedSequence) – Random number generator state.
- Return type