Logging¶
Logging.
- class metatensor.models.utils.logging.MetricLogger(model_capabilities: ModelCapabilities, initial_metrics: Dict[str, float] | List[Dict[str, float]], names: str | List[str] = '')[source]¶
Bases:
object
This class provides a simple interface to log training metrics to a file.
Initialize the metric logger. The logger is initialized with the initial metrics and names relative to the metrics (e.g., “train”, “validation”).
In this way, and by assuming that these metrics never increase, the logger can align the output to make it easier to read.
- Parameters:
- metatensor.models.utils.logging.setup_logging(logobj: Logger, logfile: str | Path | None = None, level: int = 30)[source]¶
Create a logging environment for a given
logobj
.Extracted and adjusted from github.com/MDAnalysis/mdacli/blob/main/src/mdacli/logger.py
- Parameters:
logobj (Logger) – A logging instance
level (int) – Set the root logger level to the specified level. If for example set to
logging.DEBUG
detailed debug logs inludcing filename and function name are displayed. Forlogging.INFO
only the message logged from errors, warnings and infos will be displayed.