edflow.hooks.util_hooks module¶
Summary¶
Classes:
Retrieve paths. |
|
This hook manages a set of hooks, which it will run each time its interval flag is set to True. |
Reference¶
-
class
edflow.hooks.util_hooks.
ExpandHook
(paths, interval, default=None)[source]¶ Bases:
edflow.hooks.hook.Hook
Retrieve paths.
-
class
edflow.hooks.util_hooks.
IntervalHook
(hooks, interval, start=None, stop=None, modify_each=None, modifier=<function IntervalHook.<lambda>>, max_interval=None, get_step=None)[source]¶ Bases:
edflow.hooks.hook.Hook
This hook manages a set of hooks, which it will run each time its interval flag is set to True.
-
__init__
(hooks, interval, start=None, stop=None, modify_each=None, modifier=<function IntervalHook.<lambda>>, max_interval=None, get_step=None)[source]¶ - Parameters
hook (list of Hook) – The set of managed hooks. Each must implement the methods of a
Hook
.interval (int) – The number of steps after which the managed hooks are run.
start (int) – If start is not None, the first time the hooks are run ist after start number of steps have been made.
stop (int) – If given, this hook is not evaluated anymore after stop steps.
modify_each (int) – If given, modifier is called on the interval after this many executions of thois hook. If None it is set to
interval
. In case you do not want any mofification you can either setmax_interval
tointerval
or choose the modifier to be lambda x: x or setmodify_each
to float: inf).modifier (Callable) – See modify_each.
max_interval (int) – If given, the modifier can only increase the interval up to this number of steps.
get_step (Callable) – If given, prefer over the use of batch index to determine run condition, e.g. to run based on global step.
-