@@ -131,14 +131,14 @@ def maybe_skip(learner):
131
131
132
132
@learn_with (Learner1D , bounds = (- 1 , 1 ))
133
133
def quadratic (x , m : uniform (1 , 4 ), b : uniform (0 , 1 )):
134
- return m * x ** 2 + b
134
+ return m * x ** 2 + b
135
135
136
136
137
137
@learn_with (Learner1D , bounds = (- 1 , 1 ))
138
138
@learn_with (SequenceLearner , sequence = np .linspace (- 1 , 1 , 201 ))
139
139
def linear_with_peak (x , d : uniform (- 1 , 1 )):
140
140
a = 0.01
141
- return x + a ** 2 / (a ** 2 + (x - d ) ** 2 )
141
+ return x + a ** 2 / (a ** 2 + (x - d ) ** 2 )
142
142
143
143
144
144
@learn_with (LearnerND , bounds = ((- 1 , 1 ), (- 1 , 1 )))
@@ -147,15 +147,15 @@ def linear_with_peak(x, d: uniform(-1, 1)):
147
147
def ring_of_fire (xy , d : uniform (0.2 , 1 )):
148
148
a = 0.2
149
149
x , y = xy
150
- return x + math .exp (- ((x ** 2 + y ** 2 - d ** 2 ) ** 2 ) / a ** 4 )
150
+ return x + math .exp (- ((x ** 2 + y ** 2 - d ** 2 ) ** 2 ) / a ** 4 )
151
151
152
152
153
153
@learn_with (LearnerND , bounds = ((- 1 , 1 ), (- 1 , 1 ), (- 1 , 1 )))
154
154
@learn_with (SequenceLearner , sequence = np .random .rand (1000 , 3 ))
155
155
def sphere_of_fire (xyz , d : uniform (0.2 , 0.5 )):
156
156
a = 0.2
157
157
x , y , z = xyz
158
- return x + math .exp (- ((x ** 2 + y ** 2 + z ** 2 - d ** 2 ) ** 2 ) / a ** 4 ) + z ** 2
158
+ return x + math .exp (- ((x ** 2 + y ** 2 + z ** 2 - d ** 2 ) ** 2 ) / a ** 4 ) + z ** 2
159
159
160
160
161
161
@learn_with (SequenceLearner , sequence = range (1000 ))
@@ -172,7 +172,7 @@ def noisy_peak(
172
172
offset : uniform (- 0.6 , - 0.3 ),
173
173
):
174
174
seed , x = seed_x
175
- y = x ** 3 - x + 3 * peak_width ** 2 / (peak_width ** 2 + (x - offset ) ** 2 )
175
+ y = x ** 3 - x + 3 * peak_width ** 2 / (peak_width ** 2 + (x - offset ) ** 2 )
176
176
noise = np .random .normal (0 , sigma )
177
177
return y + noise
178
178
@@ -264,7 +264,7 @@ def test_uniform_sampling2D(learner_type, f, learner_kwargs):
264
264
ys , dy = np .linspace (* ybounds , int (n * r ), retstep = True )
265
265
266
266
distances , neighbors = tree .query (list (it .product (xs , ys )), k = 1 )
267
- assert max (distances ) < math .sqrt (dx ** 2 + dy ** 2 )
267
+ assert max (distances ) < math .sqrt (dx ** 2 + dy ** 2 )
268
268
269
269
270
270
@pytest .mark .parametrize (
0 commit comments