Skip to content
Snippets Groups Projects
Commit 68689ecc authored by Tamino Huxohl's avatar Tamino Huxohl
Browse files

add functions to get values from parameter dict to random search

parent eb45a440
No related branches found
No related tags found
No related merge requests found
......@@ -78,6 +78,22 @@ class IntIntervalSampler(ParamSampler):
return random.randint(self.min_val, self.max_val)
def scatter_correction_by_params(params: Dict[str, str]):
return params["scatter_correction"] == "True"
def normalization_by_params(params: Dict[str, str]):
_norm = params["normalization"]
if "Gaussian" in _norm:
return GaussianNormTransform()
elif "Max" in _norm:
return MaxNormTransform()
elif "Mean" in _norm:
return MeanNormTransform()
else:
raise ValueError(f"Could not find normalization for param {_norm}")
class RandomSearch:
def __init__(self, param_sampler=Dict[str, ParamSampler]):
self.param_sampler = param_sampler
......
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