HALF.Hooks#
HALF.Hooks.LoadModelHook#
- class HALF.Hooks.LoadModelHook.LoadModelHook[source]#
Bases:
IHook
- __init__(name=None, path=None)[source]#
Hook to load model parameters from disk Note: if path is provided name will be ignored
- Parameters:
name (str, optional) – name of the model in the config model_path dir. Defaults to None.
path (str, optional) – path to the model. Defaults to None.
- apply(al)[source]#
Load model parameters from disk and assign them to al’s model
- Parameters:
al (ActiveLearner) – The ActiveLearner whose model weights should be loaded from disk
HALF.Hooks.SaveModelHook#
- class HALF.Hooks.SaveModelHook.SaveModelHook[source]#
Bases:
IHook
- __init__(saving_dir, name=None, with_time=False)[source]#
Saves model parameters to disk
- Parameters:
saving_dir (str) – output directory
name (str, optional) – output name for the model. Defaults to None.
with_time (bool, optional) – if True, prepend the current time to the output filename. Defaults to False.
- apply(al)[source]#
Save model parameters to disk
- Parameters:
al (ActiveLearner) – The ActiveLearner whose model parameters should be saved to disk
HALF.Hooks.SetupTensorboardHook#
HALF.Hooks.TestAccuracyLoggerHook#
HALF.Hooks.WriteAccuracyLogsHook#
- class HALF.Hooks.WriteAccuracyLogsHook.WriteAccuracyLogsHook[source]#
Bases:
IHook
- __init__(saving_dir, name)[source]#
Writes accuracy logs to disk
- Parameters:
saving_dir (str) – output directory
name (str) – output name for the accuracy logs
- apply(al)[source]#
Saves accuracy logs to csv file
- Parameters:
al (ActiveLearner) – The ActiveLearner whose accuracy logs should be written to disk