duo_ai.utils.wandb ================== .. py:module:: duo_ai.utils.wandb Classes ------- .. autoapisummary:: duo_ai.utils.wandb.WandbLogger Module Contents --------------- .. py:class:: WandbLogger Simple logger for aggregating statistics and logging to Weights & Biases (wandb). .. rubric:: Examples >>> logger = WandbLogger() >>> logger.clear() >>> logger['step'] = 1 >>> logger.add('train', {'loss': 0.1, 'acc': 0.9}) >>> stats = logger.get() .. py:method:: clear() -> None Clear the logger's internal statistics dictionary. :rtype: None .. rubric:: Examples >>> logger = WandbLogger() >>> logger.clear() .. py:method:: __setitem__(key: str, value: Any) -> None Set a statistic in the logger by key. :param key: The key for the statistic. :type key: str :param value: The value to store. :type value: Any :rtype: None .. rubric:: Examples >>> logger = WandbLogger() >>> logger['step'] = 1 .. py:method:: add(split: str, stats: Dict[str, Any]) -> None Add multiple statistics for a given split, prefixing keys with the split name. :param split: The split name (e.g., 'train', 'test'). :type split: str :param stats: Dictionary of statistics to add. :type stats: dict :rtype: None .. rubric:: Examples >>> logger = WandbLogger() >>> logger.add('train', {'loss': 0.1, 'acc': 0.9}) .. py:method:: get() -> Dict[str, Any] Retrieve the current statistics dictionary. :returns: The current statistics log. :rtype: dict .. rubric:: Examples >>> logger = WandbLogger() >>> logger.clear() >>> logger['step'] = 1 >>> logger.add('train', {'loss': 0.1, 'acc': 0.9}) >>> stats = logger.get()