pydvl.utils.progress
¶
repeat_indices
¶
repeat_indices(
indices: Collection[int],
result: ValuationResult,
done: StoppingCriterion,
**kwargs
) -> Iterator[int]
Helper function to cycle indefinitely over a collection of indices until the stopping criterion is satisfied while displaying progress.
PARAMETER | DESCRIPTION |
---|---|
indices |
Collection of indices that will be cycled until done.
TYPE:
|
result |
Object containing the current results.
TYPE:
|
done |
Stopping criterion.
TYPE:
|
kwargs |
Keyword arguments passed to tqdm.
DEFAULT:
|
Source code in src/pydvl/utils/progress.py
log_duration
¶
Decorator to log execution time of a function with a configurable logging level. It can be used with or without specifying a log level.