BaseLogger
minnt.loggers.BaseLogger
Bases: Logger
An abstract logger providing base functionality for other loggers.
Source code in minnt/loggers/base_logger.py
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 | |
log_figure
log_figure(
label: str,
figure: Any,
epoch: int,
tight_layout: bool = True,
close: bool = True,
) -> Self
Log the given matplotlib Figure with the given label at the given epoch.
Parameters:
-
label(str) –The label of the logged image.
-
figure(Any) –A matplotlib Figure.
-
epoch(int) –The epoch number at which the image is logged.
-
tight_layout(bool, default:True) –Whether to apply tight layout to the figure before logging it.
-
close(bool, default:True) –Whether to close the figure after logging it.
Source code in minnt/loggers/base_logger.py
20 21 22 23 24 25 26 27 28 29 30 31 | |
format_config_as_json
staticmethod
Make a formatted JSON from configuration and epoch number.
Source code in minnt/loggers/base_logger.py
33 34 35 36 | |
format_config_as_text
staticmethod
Make a human-readable plain text from configuration and epoch number.
Source code in minnt/loggers/base_logger.py
38 39 40 41 42 43 44 | |
format_metrics
staticmethod
Make a human-readable string from the logged metrics.
Source code in minnt/loggers/base_logger.py
46 47 48 49 | |
graph_in_eval_mode
graph_in_eval_mode(graph: Module)
Context manager to temporarily set the training mode of graph to eval.
Source code in minnt/loggers/base_logger.py
51 52 53 54 55 56 57 58 59 60 61 62 | |
preprocess_audio
staticmethod
Produce a CPU-based torch.Tensor with dtype=torch.int16 and shape (L, {1/2}).
Source code in minnt/loggers/base_logger.py
64 65 66 67 68 69 70 71 72 73 74 | |
preprocess_image
staticmethod
preprocess_image(image: AnyArray, data_format: DataFormat = 'HWC') -> Tensor
Produce a CPU-based torch.Tensor with dtype=torch.uint8 and shape (H, W, {1/3/4}).
Source code in minnt/loggers/base_logger.py
76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 | |