neuralib.util.tqdm.tqdm_joblib

neuralib.util.tqdm.tqdm_joblib(tqdm_obj)[source]

Context manager to patch joblib multiprocessing to report into tqdm progress bar given as argument

Example of running foreach neuron shuffle:

from joblib import Parallel, delayed

func = ... # Callable[*args, Any], arg include foreach *n*

with tqdm_joblib(tqdm(desc="lower bound", unit='neuron', ncols=80)) as _:
    Parallel(n_jobs=self.parallel_jobs, backend='multiprocessing', verbose=True)(
        delayed(func)
        (*args)
        for n in neuron_list
Parameters:

tqdm_obj (tqdm) – tqdm object

Returns:

tqdm context manger

Return type:

Iterator[tqdm]