Add SuperSimpleNorm and update synthetic env

This commit is contained in:
D-X-Y
2021-04-23 02:12:11 -07:00
parent a5b7d986b3
commit 9b895bdf2e
13 changed files with 238 additions and 519 deletions

View File

@@ -33,6 +33,14 @@ class FitFunc(abc.ABC):
def __call__(self, x):
raise NotImplementedError
def noise_call(self, x, std=0.1):
clean_y = self.__call__(x)
if isinstance(clean_y, np.ndarray):
noise_y = clean_y + np.random.normal(scale=std, size=clean_y.shape)
else:
raise ValueError("Unkonwn type: {:}".format(type(clean_y)))
return noise_y
@abc.abstractmethod
def _getitem(self, x):
raise NotImplementedError