Skip to content

Commit e744458

Browse files
doc the peek attr
1 parent 8fdeeca commit e744458

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

autoPyTorch/utils/backend.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,28 @@ def get_numrun_directory(self, seed: int, num_run: int, budget: float) -> str:
334334
return os.path.join(self.internals_directory, 'runs', '%d_%d_%s' % (seed, num_run, budget))
335335

336336
def get_next_num_run(self, peek: bool = False) -> int:
337+
"""
338+
Every pipeline that is fitted by the estimator is stored with an
339+
identifier called num_run. A dummy classifier will always have a num_run
340+
equal to 1, and all other new configurations that are explored will
341+
have a sequentially increasing identifier.
342+
343+
This method returns the next num_run a configuration should take.
344+
345+
Parameters
346+
----------
347+
peek: bool
348+
By default, the next num_rum will be returned, i.e. self.active_num_run + 1
349+
Yet, if this bool parameter is equal to True, the value of the current
350+
num_run is provided, i.e, self.active_num_run.
351+
In other words, peek allows to get the current maximum identifier
352+
of a configuration.
353+
354+
Returns
355+
-------
356+
num_run: int
357+
An unique identifier for a configuration
358+
"""
337359

338360
# If there are other num_runs, their name would be runs/<seed>_<num_run>_<budget>
339361
other_num_runs = [int(os.path.basename(run_dir).split('_')[1])

0 commit comments

Comments
 (0)