From b81cb2050693bcd3e9f19aba2a768fcaec02d272 Mon Sep 17 00:00:00 2001 From: Theo Steininger <theo.steininger@ultimanet.de> Date: Tue, 18 Jul 2017 15:04:23 +0200 Subject: [PATCH] Added dtype option to prober. --- nifty/minimization/line_searching/line_search.py | 3 --- nifty/probing/prober/prober.py | 5 ++++- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/nifty/minimization/line_searching/line_search.py b/nifty/minimization/line_searching/line_search.py index 6debbc5d2..93ede56af 100644 --- a/nifty/minimization/line_searching/line_search.py +++ b/nifty/minimization/line_searching/line_search.py @@ -44,9 +44,6 @@ class LineSearch(Loggable, object): __metaclass__ = abc.ABCMeta def __init__(self): - - - self.line_energy = None self.f_k_minus_1 = None self.preferred_initial_step_size = None diff --git a/nifty/probing/prober/prober.py b/nifty/probing/prober/prober.py index b2f85f543..f292c495f 100644 --- a/nifty/probing/prober/prober.py +++ b/nifty/probing/prober/prober.py @@ -37,7 +37,8 @@ class Prober(object): """ def __init__(self, domain=None, distribution_strategy=None, probe_count=8, - random_type='pm1', compute_variance=False): + random_type='pm1', probe_dtype=np.float, + compute_variance=False): self._domain = utilities.parse_domain(domain) self._distribution_strategy = \ @@ -45,6 +46,7 @@ class Prober(object): self._probe_count = self._parse_probe_count(probe_count) self._random_type = self._parse_random_type(random_type) self.compute_variance = bool(compute_variance) + self.probe_dtype = np.dtype(probe_dtype) # ---Properties--- @@ -104,6 +106,7 @@ class Prober(object): """ a random-probe generator """ f = Field.from_random(random_type=self.random_type, domain=self.domain, + dtype=self.probe_dtype, distribution_strategy=self.distribution_strategy) uid = np.random.randint(1e18) return (uid, f) -- GitLab