MCPcopy
hub / github.com/hyperopt/hyperopt / fmin

Method fmin

hyperopt/spark.py:190–275  ·  view source on GitHub ↗

This should not be called directly but is called via :func:`hyperopt.fmin` Refer to :func:`hyperopt.fmin` for docs on each argument

(
        self,
        fn,
        space,
        algo,
        max_evals,
        timeout,
        loss_threshold,
        max_queue_len,
        rstate,
        verbose,
        pass_expr_memo_ctrl,
        catch_eval_exceptions,
        return_argmin,
        show_progressbar,
        early_stop_fn,
        trials_save_file="",
    )

Source from the content-addressed store, hash-verified

188 raise NotImplementedError("SparkTrials does not support trial attachments.")
189
190 def fmin(
191 self,
192 fn,
193 space,
194 algo,
195 max_evals,
196 timeout,
197 loss_threshold,
198 max_queue_len,
199 rstate,
200 verbose,
201 pass_expr_memo_ctrl,
202 catch_eval_exceptions,
203 return_argmin,
204 show_progressbar,
205 early_stop_fn,
206 trials_save_file="",
207 ):
208 """
209 This should not be called directly but is called via :func:`hyperopt.fmin`
210 Refer to :func:`hyperopt.fmin` for docs on each argument
211 """
212
213 if timeout is not None:
214 if self.timeout is not None:
215 logger.warning(
216 "Timeout param was defined in Trials object, ignoring fmin definition"
217 )
218 else:
219 validate_timeout(timeout)
220 self.timeout = timeout
221
222 if loss_threshold is not None:
223 validate_loss_threshold(loss_threshold)
224 self.loss_threshold = loss_threshold
225
226 assert (
227 not pass_expr_memo_ctrl
228 ), "SparkTrials does not support `pass_expr_memo_ctrl`"
229 assert (
230 not catch_eval_exceptions
231 ), "SparkTrials does not support `catch_eval_exceptions`"
232
233 state = _SparkFMinState(self._spark, fn, space, self)
234
235 # Will launch a dispatcher thread which runs each trial task as one spark job.
236 state.launch_dispatcher()
237
238 try:
239 res = fmin(
240 fn,
241 space,
242 algo,
243 max_evals,
244 timeout=timeout,
245 loss_threshold=loss_threshold,
246 max_queue_len=max_queue_len,
247 trials=self,

Callers

nothing calls this directly

Calls 12

count_total_trialsMethod · 0.95
count_failed_trialsMethod · 0.95
validate_timeoutFunction · 0.90
validate_loss_thresholdFunction · 0.90
fminFunction · 0.90
_SparkFMinStateClass · 0.85
launch_dispatcherMethod · 0.80
debugMethod · 0.80
wait_for_all_threadsMethod · 0.80
infoMethod · 0.80

Tested by

no test coverage detected