Skip to content
Snippets Groups Projects
Commit 00982fae authored by Jörg Martin's avatar Jörg Martin
Browse files

Added repeated linear and quadratic

parent abf78c52
No related merge requests found
"""
Repeated sampling from the linear dataset.
"""
from EIVData import linear
from EIVData.repeated_sampling import repeated_sampling
fixed_seed = 0
load_data = repeated_sampling(dataclass=linear,
fixed_seed=fixed_seed)
"""
Repeated sampling from the quadratic dataset.
"""
from EIVData import quadratic
from EIVData.repeated_sampling import repeated_sampling
fixed_seed = 0
load_data = repeated_sampling(dataclass=quadratic,
fixed_seed=fixed_seed)
"""
Contains the class `repeated_sampling` that can be used to generate
datasets for repeated sampling from datasets with a ground truth.
"""
import sys
import torch
......@@ -6,6 +10,19 @@ from torch.utils.data import TensorDataset
from EIVGeneral.manipulate_tensors import add_noise
class repeated_sampling():
"""
A class for repeated sampling from datasets with a known ground truth and
known input and output noise. The class `dataclass` should contain a
`load_data` routine that returns a ground truth and two positive floats
`x_noise_strength` and `y_noise_strength` that will be used as the standard
deviation of input and output noise.
:param dataclass: A module that contains a routine `load_data`, which
accepts the keyword `return_ground_truth` and returns the noisy and true
train and test datasets, and two positive floats `x_noise_strength` and
`y_noise_strength`.
:param fixed_seed: Integer. The seed to load the unnoisy ground truth,
defaults to 0.
"""
def __init__(self, dataclass, fixed_seed=0):
self.dataclass = dataclass
self.fixed_seed = fixed_seed
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment